Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         var x1 = double.Parse(Console.ReadLine());
  7.         var y1 = double.Parse(Console.ReadLine());
  8.         var x2 = double.Parse(Console.ReadLine());
  9.         var y2 = double.Parse(Console.ReadLine());
  10.  
  11.         var area = 2 * (Math.Abs(x2 - x1) + Math.Abs(y1 - y2));
  12.         var perimmeter = Math.Abs(x2 - x1) * Math.Abs(y1 - y2);
  13.  
  14.         Console.WriteLine("{0}", perimmeter);
  15.         Console.WriteLine("{0}", area);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement