using System;
using System.Drawing;
namespace App
{
class Triangle
public Point A { get; }
public Point B { get; }
public Point C { get; }
public Triangle(int x1, int y1, int x2, int y2, int x3, int y3)
A = new Point(x1, y1);
B = new Point(x2, y2);
C = new Point(x3, y3);
}
public override string ToString() => $"A({A.X},{A.Y}); B({B.X},{B.Y}); C({C.X},{C.Y})";
class Program
static void Main(string[] args)
Triangle triangle = new Triangle(0, 0, 1, 2, 3, 2); // x1,y1,x2,y2,x3,y3
Console.WriteLine(triangle.ToString()); // Вывод: A(0,0); B(1,2); C(3,2)
Объяснение:
using System;
using System.Drawing;
namespace App
{
class Triangle
{
public Point A { get; }
public Point B { get; }
public Point C { get; }
public Triangle(int x1, int y1, int x2, int y2, int x3, int y3)
{
A = new Point(x1, y1);
B = new Point(x2, y2);
C = new Point(x3, y3);
}
public override string ToString() => $"A({A.X},{A.Y}); B({B.X},{B.Y}); C({C.X},{C.Y})";
}
class Program
{
static void Main(string[] args)
{
Triangle triangle = new Triangle(0, 0, 1, 2, 3, 2); // x1,y1,x2,y2,x3,y3
Console.WriteLine(triangle.ToString()); // Вывод: A(0,0); B(1,2); C(3,2)
}
}
}
Объяснение: