题解 | #牛牛的线段#
牛牛的线段
https://www.nowcoder.com/practice/f72c56ed71664af082c921bf79861c85
using System; public class Program { public static void Main() { string Input; string InputNum = ""; while ((Input = Console.ReadLine()) != null) { InputNum += Input; InputNum+=" "; } string[] Num = InputNum.Split(" "); int x1 = int.Parse(Num[0]); int y1 = int.Parse(Num[1]); int x2 = int.Parse(Num[2]); int y2 = int.Parse(Num[3]); int total = (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); Console.WriteLine(total); } }