Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Renovation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int height = int.Parse(Console.ReadLine());
  10.             int width = int.Parse(Console.ReadLine());
  11.             int windows = int.Parse(Console.ReadLine());
  12.             int area =(int) Math.Ceiling(height * width * (1 - windows / 100.0)*4);
  13.  
  14.             while(area>0)
  15.             {
  16.                 string command = Console.ReadLine();
  17.                 if(command=="Tired!")
  18.                 {
  19.                     Console.WriteLine($"{area} quadratic m left.");
  20.                     return;
  21.                 }
  22.                
  23.                 int paint = int.Parse(command);
  24.                
  25.                 area -= paint;
  26.                
  27.             }
  28.            
  29.             if (area<0)
  30.             {
  31.                 Console.WriteLine($"All walls are painted and you have {Math.Abs(area)} l paint left!");
  32.             }
  33.             else
  34.             {
  35.                 Console.WriteLine("All walls are painted! Great job, Pesho!");
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement