Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Best_Player
- {
- class Program
- {
- static void Main(string[] args)
- {
- double capacity = double.Parse(Console.ReadLine());
- double loadedSuitcase = 0;
- double suitcaseSize = 0;
- double lineIn = 0;
- while (true)
- {
- string line = Console.ReadLine();
- if (line == "End")
- {
- Console.WriteLine("Congratulations! All suitcases are loaded!");
- break;
- }
- if ((suitcaseSize +1) % 3 == 0)
- {
- lineIn = int.Parse(line);
- suitcaseSize = lineIn * 0.1;
- suitcaseSize = lineIn;
- loadedSuitcase++;
- }
- double leftedSpace = capacity - lineIn;
- loadedSuitcase++;
- leftedSpace -= lineIn;
- if (capacity <= suitcaseSize)
- {
- Console.WriteLine("No more space!");
- }
- }
- Console.WriteLine($"Statistic: {loadedSuitcase} suitcases loaded.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement