Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace OwnBusiness
- {
- class Program
- {
- static void Main(string[] args)
- {
- //input
- var a = int.Parse(Console.ReadLine());
- var b = int.Parse(Console.ReadLine());
- var c = int.Parse(Console.ReadLine());
- var volumeOfRoom = a * b * c;
- var sumOfAlPc = 0;
- var temp = 0;
- var command = Console.ReadLine();
- var check = true;
- //logic
- while (command != "Done")
- {
- temp = int.Parse(command);
- sumOfAlPc += temp;
- if (sumOfAlPc>volumeOfRoom)
- {
- check = false;
- var diff = sumOfAlPc - volumeOfRoom;
- Console.WriteLine($"No more free space! You need {diff} Cubic meters more.");
- break;
- }
- command = Console.ReadLine();
- }
- if (check)
- {
- Console.WriteLine($"{volumeOfRoom - sumOfAlPc} Cubic meters left.");
- }
- //output
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement