Advertisement
Guest User

02. Picture in the Wall

a guest
Jul 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02.Picture_in_the_Wall
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int holeWidth = int.Parse(Console.ReadLine());
  10. int holeHeigth = int.Parse(Console.ReadLine());
  11. int picturesSides = int.Parse(Console.ReadLine());
  12. int countPictures = int.Parse(Console.ReadLine());
  13.  
  14. int holeArea = holeWidth * holeHeigth;
  15. int picturesArea = picturesSides * picturesSides * countPictures;
  16. if(holeArea > picturesArea)
  17. Console.WriteLine($"The pictures fit in the hole. Hole area is {holeArea - picturesArea} bigger than pictures area.");
  18. else
  19. Console.WriteLine($"The pictures don't fit in the hole. Picture area is {picturesArea - holeArea} bigger than hole area.");
  20. }
  21. }
  22. }
  23. //start -> 22:03
  24. //end -> 22:11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement