Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- amespace _05._Bachelor_Party
- {
- class Program
- {
- static void Main(string[] args)
- {
- double singer = double.Parse(Console.ReadLine());
- double counterGuests = 0;
- double moneyCounter = 0;
- while (true)
- {
- string command = Console.ReadLine();
- if(command == "The restaurant is full")
- {
- break;
- }
- double waveofG = double.Parse(command);
- counterGuests += waveofG;
- if(waveofG>=5)
- {
- moneyCounter += waveofG * 70;
- }
- else
- {
- moneyCounter += waveofG * 100;
- }
- }
- double moneyLEft = moneyCounter - singer;
- if(moneyLEft>0)
- {
- Console.WriteLine($"You have {counterGuests} guests and {moneyLEft} leva left.");
- }
- else
- {
- Console.WriteLine($"You have {counterGuests} guests and {moneyCounter} leva income, but no singer.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement