Консоль сразу же закрывается - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication14
{
class Point
{
static void Main(string[] args)
{
}
private double x;
private double y;
public Point()
{
x = 0;
y = 0;
}
public Point(double _x, double _y)
{
x = _x;
y = _y;
}
public Point(Point _point)
: this(_point.x, _point.y)
{
}
public static double FromPointToPoint(Point _point1, Point _point2)
{
return Math.Sqrt(Math.Pow((_point1.x - _point2.x), 2) + Math.Pow((_point1.y - _point2.y), 2));
}
public static double FromPointToStart(Point _point1)
{
return FromPointToPoint(_point1, new Point());
}
public double X
{
set
{
x = value;
}
get
{
return x;
}
}
public double Y
{
set
{
y = value;
}
get
{
return y;
}
}
public void ShiftX(double _shift)
{
x += _shift;
}
public void ShiftY(double _shift)
{
y += _shift;
}
public override string ToString()
{
return "(" + x + "|" + y + ")";
}
}
}Решение задачи: «Консоль сразу же закрывается»
textual
Листинг программы
Console.ReadKey();