Advertisement
viraco4a

Untitled

Mar 12th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace PictureInTheWall
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. int holeWidth = int.Parse(Console.ReadLine());
  10. int holeLength = int.Parse(Console.ReadLine());
  11. int paintingSide = int.Parse(Console.ReadLine());
  12. int numberOfPaintings = int.Parse(Console.ReadLine());
  13. int areaHole = holeLength * holeWidth;
  14. int areaPaintings = numberOfPaintings * paintingSide * paintingSide;
  15. int diff = Math.Abs(areaHole - areaPaintings);
  16. if (areaHole >= areaPaintings)
  17. {
  18. Console.WriteLine($"The pictures fit in the hole. Hole area is {diff} bigger than pictures area.");
  19. }
  20. else
  21. {
  22. Console.WriteLine($"The pictures don't fit in the hole. Picture area is {diff} bigger than hole area.");
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement