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