Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _4.Own_Bussiness
- {
- class Program
- {
- static void Main(string[] args)
- {
- int widthFreePlace = int.Parse(Console.ReadLine());
- int lenghtFreePlace = int.Parse(Console.ReadLine());
- int heightFreePlace = int.Parse(Console.ReadLine());
- string command = string.Empty;
- double areaFreePlace = 0;
- double areaBox = 0;
- while((command = Console.ReadLine()) != "Done")
- {
- areaFreePlace = widthFreePlace * lenghtFreePlace * heightFreePlace;
- int numberBox = int.Parse(command);
- areaBox += numberBox;
- if(areaFreePlace < areaBox && command != "Done")
- {
- break;
- }
- }
- if(areaFreePlace > 0 && command == "Done")
- {
- Console.WriteLine($"{areaFreePlace - areaBox} Cubic meters left.");
- }
- else
- {
- Console.WriteLine($"No more free space! You need {Math.Abs(areaFreePlace - areaBox)} Cubic meters more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement