VelizarAvramov

07. 2D Rectangle Area

Mar 19th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _2D_Rectangle_Area
  8. {
  9.     class RectangularArea2D
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var x1 = double.Parse(Console.ReadLine());
  14.             var y1 = double.Parse(Console.ReadLine());
  15.             var x2 = double.Parse(Console.ReadLine());
  16.             var y2 = double.Parse(Console.ReadLine());
  17.  
  18.             var a = Math.Abs(x1 - x2);
  19.             var b = Math.Abs(y2 - y1);
  20.             Console.WriteLine(a * b);
  21.             Console.WriteLine(2 * (a + b));
  22.  
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment