Advertisement
Egonau

Untitled

Jan 15th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NewLesson1
  4. {
  5.     class Program
  6.     {
  7.         struct Point
  8.         {
  9.            public int x;
  10.            public int y;
  11.             public Point(int x, int y)
  12.             {
  13.                 this.x = x;
  14.                 this.y = y;
  15.             }
  16.             public override string ToString()
  17.             {
  18.                 return $"{x} {y}";
  19.             }
  20.             public static void sort(Point[] points)
  21.             {
  22.                
  23.             }
  24.             public static Point operator+(Point left, Point right)
  25.             {
  26.                 return new Point(left.x + right.x, left.y + right.y);
  27.             }
  28.         }
  29.         static void Main(string[] args)
  30.         {
  31.             Point[] points = new Point[3];
  32.             points[0] = new Point(1, 2);
  33.             points[1] = new Point(3, 4);
  34.             points[2] = new Point(5, 6);
  35.             Point.sort(points);
  36.             Console.WriteLine(p1+p2);
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement