Advertisement
Sim0o0na

2. Picture in the Wall

Mar 12th, 2018
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 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 _02
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int holeW = int.Parse(Console.ReadLine());
  14.             int holeH = int.Parse(Console.ReadLine());
  15.             int pictureSide = int.Parse(Console.ReadLine());
  16.             int numberPictures = int.Parse(Console.ReadLine());
  17.  
  18.  
  19.             int holeSize = holeH * holeW;
  20.             int pictureSize = pictureSide * pictureSide;
  21.             int allPicturesSize = pictureSize * numberPictures;
  22.  
  23.             if (holeSize < allPicturesSize )
  24.             {
  25.                 Console.WriteLine(
  26.  "The pictures don't fit in the hole. Picture area is {0} bigger than hole area.", allPicturesSize - holeSize);
  27.             }
  28.             else
  29.             {
  30.                 Console.WriteLine("The pictures fit in the hole. Hole area is {0} bigger than pictures area.", holeSize - allPicturesSize);
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement