05. Suitcases Load
Защо получавам 70/100 на задачата 05. Suitcases Load от задачите Programming Basics Online Exam - 28 and 29 March 2020
using System;
namespace _05._Suitcases_Load
{
class Program
{
static void Main(string[] args)
{
var luggageCapacity = double.Parse(Console.ReadLine());
var command = Console.ReadLine();
var luggageVolume = 0.0;
var count = 0;
while (command != "End")
{
luggageVolume = double.Parse(command);
if (count % 3 == 0)
{
luggageVolume *= 1.1;
}
if (luggageCapacity<luggageVolume)
{
Console.WriteLine("No more space!");
break;
}
luggageCapacity -= luggageVolume;
command = Console.ReadLine();
count++;
}
if (command == "End" )
{
Console.WriteLine("Congratulations! All suitcases are loaded!");
}
Console.WriteLine($"Statistic: {count} suitcases loaded.");
}
}
}