Guest User

Untitled

a guest
Jun 28th, 2016
419
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _13AreaOfFigures
  8. {
  9. class AreaOfFigures
  10. {
  11. static void Main(string[] args)
  12. {
  13. string figures = Console.ReadLine();
  14. switch (figures)
  15. {
  16. case "square":
  17. double n = double.Parse(Console.ReadLine());
  18. double result = n * n;
  19. Console.WriteLine(result); break;
  20. case "rectangle":
  21. double a = double.Parse(Console.ReadLine());
  22. double b = double.Parse(Console.ReadLine());
  23. double first = a * b;
  24. Console.WriteLine(first); break;
  25. case "circle":
  26. double r = double.Parse(Console.ReadLine());
  27. double second = Math.PI * r * r;
  28. Console.WriteLine("{0:F3}", second); break;
  29. case "triangle":
  30. double c = double.Parse(Console.ReadLine());
  31. double d = double.Parse(Console.ReadLine());
  32. double third = c * d / 2;
  33. Console.WriteLine(third); break;
  34. }
  35. }
  36. }
  37. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×