Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace KirillLesson2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Point p1 = new Point();
- p1.X = 0;
- p1.Y = 0;
- Point p2 = new Point();
- p1.X = 2;
- p1.Y = 2;
- Rectangle rectangle = new Rectangle();
- rectangle.p1 = p1;
- rectangle.p2 = p2;
- Console.WriteLine(rectangle.Square());
- }
- }
- class Rectangle
- {
- public Point p1;
- public Point p2;
- public int Square()
- {
- return Math.Abs((p1.X - p2.X) * (p1.Y - p2.Y));
- }
- public bool Intersects(Rectangle other)
- {
- // проперка пересечения
- // TODO
- //
- return false;
- }
- public bool Contains(Rectangle other)
- {
- // содержит ли
- // TODO
- //
- return false;
- }
- // Периметр
- // TODO
- //
- }
- class Point
- {
- public int X;
- public int Y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement