题解 | #牛牛的线段#

牛牛的线段

https://www.nowcoder.com/practice/f72c56ed71664af082c921bf79861c85

using System;
public class Program {
    public static void Main() {
        string[] s = new string[2];
        int[,] num = new int[2,2];
        int i = 0;
        while(i < 2 && (s[i] = Console.ReadLine()) != null)
        {
            num[i,0] = int.Parse(s[i].Split(" ")[0]);
            num[i,1] = int.Parse(s[i].Split(" ")[1]);
            i++;
        }
        double d = System.Math.Pow(num[1,0]-num[0,0] ,2) + System.Math.Pow(num[1,1]-num[0,1] ,2);

        Console.WriteLine(d);

    }
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-09 11:15
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-08 17:10
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务