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