Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int wallHeight = int.Parse(Console.ReadLine());
- int wallWidth = int.Parse(Console.ReadLine());
- int percentNonPaint = int.Parse(Console.ReadLine());
- int wallsToPaint = wallHeight * wallWidth * 4;
- double afterPercent = Math.Ceiling(wallsToPaint - wallsToPaint * (1.0 * percentNonPaint / 100));
- string command = Console.ReadLine();
- while (command != "Tired!")
- {
- int paint = int.Parse(command);
- afterPercent -= paint;
- if (afterPercent <= 0)
- {
- break;
- }
- command = Console.ReadLine();
- }
- if (afterPercent < 0)
- {
- Console.WriteLine($"All walls are painted and you have {Math.Abs(afterPercent)} l paint left!");
- }
- else if(afterPercent == 0)
- {
- Console.WriteLine($"All walls are painted! Great job, Pesho!");
- }
- else
- {
- Console.WriteLine($"{afterPercent} quadratic m left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment