Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _2DRectangleArea
- {
- class Program
- {
- static void Main(string[] args)
- {
- double y1 = double.Parse(Console.ReadLine());
- double x2 = double.Parse(Console.ReadLine());
- double y2 = double.Parse(Console.ReadLine());
- double x1 = double.Parse(Console.ReadLine());
- double width = Math.Abs(x1 - x2);
- double height = Math.Abs(y1 - y2);
- double area = width * height;
- double perimeter = (width + height) * 2;
- Console.WriteLine($"{area}\r\n{perimeter}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement