Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- int capacity = int.Parse(Console.ReadLine());
- int income = 0;
- string command = Console.ReadLine();
- while (command != "Movie time!")
- {
- int traffic = int.Parse(command);
- capacity -= traffic;
- if (capacity < 0)
- {
- Console.WriteLine("The cinema is full.");
- break;
- }
- if (traffic % 3 == 0)
- {
- income += traffic * 5 - 5;
- }
- else
- {
- income += traffic * 5;
- }
- command = Console.ReadLine();
- }
- if (command == "Movie time!")
- {
- Console.WriteLine($"There are {capacity} seats left in the cinema.");
- }
- Console.WriteLine($"Cinema income - {income} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement