Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BachelorParty
- {
- class Program
- {
- static void Main(string[] args)
- {
- int gestArtist = int.Parse(Console.ReadLine());
- int totalSum = 0;
- int totalGests = 0;
- while(true)
- {
- string input = Console.ReadLine();
- if (input == "The restaurant is full")
- {
- break;
- }
- else
- {
- int group = int.Parse(input);
- if (group < 5)
- {
- totalSum += (group * 100);
- }
- else
- {
- totalSum += (group*70);
- }
- totalGests += group;
- }
- }
- int diff = totalSum - gestArtist;
- if (diff >= 0)
- {
- Console.WriteLine($"You have {totalGests} guests and {diff} leva left.");
- }
- else
- {
- Console.WriteLine($"You have {totalGests} guests and {totalSum} leva income, but no singer.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment