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;
- using System.Threading.Tasks;
- namespace _07_2DRectangleArea
- {
- class Program
- {
- static void Main(string[] args)
- {
- var x1 = double.Parse(Console.ReadLine());
- var y1 = double.Parse(Console.ReadLine());
- var x2 = double.Parse(Console.ReadLine());
- var y2 = double.Parse(Console.ReadLine());
- var a = Math.Max(x1, x2) - Math.Min(x1, x2);
- var b = Math.Max(y1, y2) - Math.Min(y1, y2);
- var area = a * b;
- var perimeter = (2 * a) + (2 * b);
- Console.WriteLine(area);
- Console.WriteLine(perimeter);
- }
- }
- }
Add Comment
Please, Sign In to add comment