Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyApp
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int width = int.Parse(Console.ReadLine());
- int length = int.Parse(Console.ReadLine());
- int heigth = int.Parse(Console.ReadLine());
- int apartamentPlace = width * length * heigth;
- while (true)
- {
- string boxOrComand = Console.ReadLine();
- if (boxOrComand != "Done")
- {
- int boxMulve = int.Parse(boxOrComand);
- if (apartamentPlace > 0 )
- {
- apartamentPlace -= boxMulve;
- if (apartamentPlace <0)
- {
- Console.WriteLine($"No more free space! You need { Math.Abs(apartamentPlace)} Cubic meters more.");
- break;
- }
- }
- else
- {
- Console.WriteLine($"No more free space! You need {Math.Abs(apartamentPlace)} Cubic meters more.");
- break;
- }
- }
- else
- {
- Console.WriteLine($"{apartamentPlace} Cubic meters left.");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement