题解 | #牛牛的线段#
牛牛的线段
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); } }