Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _10.Moving
- {
- class Moving
- {
- static void Main(string[] args)
- {
- int w = int.Parse(Console.ReadLine());
- int l = int.Parse(Console.ReadLine());
- int h = int.Parse(Console.ReadLine());
- string command = Console.ReadLine();
- int space = w * l * h;
- int volume = 0;
- while (command != "Done")
- {
- int commandNum = int.Parse(command);
- volume += commandNum;
- if (volume >= space)
- {
- Console.WriteLine($"No more free space! You need {volume - space} Cubic meters more.");
- break;
- }
- command = Console.ReadLine();
- }
- if (volume < space)
- {
- Console.WriteLine($"{space - volume} Cubic meters left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement