Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Exam_Bachelor_Party
- {
- class Program
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- int people = int.Parse(Console.ReadLine());
- string command = Console.ReadLine();
- double couvert = 0;
- double sum = 0;
- int guests = 0;
- while ((command = Console.ReadLine()) != "The restaurant is full")
- {
- if (people < 5)
- {
- couvert = 100;
- guests += people;
- }
- else
- {
- couvert = 70;
- guests += people;
- }
- sum += couvert * people;
- if (sum > money)
- {
- Console.WriteLine($"You have {guests} guests and {sum - money} leva left.");
- }
- else if (sum < money)
- {
- Console.WriteLine($"You have {guests} guests and {money - sum} leva income, but no singer.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment