braveheart1989

07.Rectangle_Area

Mar 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 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 _07.Rectangle_Area
  8. {
  9.     class Rectangle_Area
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double x1 = double.Parse(Console.ReadLine());
  14.             double y1 = double.Parse(Console.ReadLine());
  15.             double x2 = double.Parse(Console.ReadLine());
  16.             double y2 = double.Parse(Console.ReadLine());
  17.             Console.WriteLine("{0:F4}",Math.Abs(x1-x2) * Math.Abs(y1-y2));
  18.             Console.WriteLine(2*(Math.Abs(x1 - x2) + Math.Abs(y1 - y2)));
  19.         }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment