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