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