![]() |
#2
yhlvht2017-03-14 21:42
|




namespace wenbenwenjian
{
public struct Point
{
public double X;
public double Y;
}
class Program
{
static void Main(string[] args)
{
// Point[] pts = new Point[10];
List<Point> points = new List<Point>();
Point pt1 = new Point();
StreamReader sr = new StreamReader("11改.txt");
string content = sr.ReadToEnd();
string[] str = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
for (int i = 0; i < str.Length; i++)
{
Console.WriteLine("第 {0} 行: {1}", i + 1, str[i]);
Console.ReadLine();
}
pt1.X = Convert.ToDouble(str[1]);
pt1.Y = Convert.ToDouble(str[2]);
points.Add(pt1);
double dist = (points[1].Y - points[0].Y) * (points[1].Y - points[0].Y) + (points[1].X - points[0].X) * (points[1].X - points[0].X);
double RESULT = Math.Sqrt(Math.Abs(dist));
Console.WriteLine(RESULT);
Console.ReadKey();
}
}
}