Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NewLesson1
- {
- class Program
- {
- struct Point
- {
- public int x;
- public int y;
- public Point(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
- public override string ToString()
- {
- return $"{x} {y}";
- }
- public static void sort(Point[] points)
- {
- }
- public static Point operator+(Point left, Point right)
- {
- return new Point(left.x + right.x, left.y + right.y);
- }
- }
- static void Main(string[] args)
- {
- Point[] points = new Point[3];
- points[0] = new Point(1, 2);
- points[1] = new Point(3, 4);
- points[2] = new Point(5, 6);
- Point.sort(points);
- Console.WriteLine(p1+p2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement