Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq.Expressions;
- namespace Add_Bags
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hight = int.Parse(Console.ReadLine());
- int length = int.Parse(Console.ReadLine());
- int percentage = int.Parse(Console.ReadLine());
- const int walls = 4;
- double totalCover = 0;
- double count = 0;
- totalCover = hight * length * walls;
- totalCover -= totalCover * (percentage * 0.01);
- while (true)
- {
- string line = Console.ReadLine();
- if (line == "Tired!")
- {
- Console.WriteLine($"{totalCover} quadratic m left.");
- return; //за да приключи
- }
- count = int.Parse(line);
- totalCover -= count;
- if (totalCover == 0) //ако е всичко е боядисано и няма останало
- {
- Console.WriteLine($"All walls are painted! Great job, Pesho!");
- return; //за да приключи
- }
- else if(totalCover < 0) //ако е всичко е боядисано и има останало
- {
- Console.WriteLine($"All walls are painted and you have {Math.Abs(totalCover)} l paint left!");
- return; //за да приключи
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement