Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ExcursionSale
- {
- class Program
- {
- static void Main(string[] args)
- {
- int seaCount = int.Parse(Console.ReadLine());
- int mountCount = int.Parse(Console.ReadLine());
- int totalSum = 0;
- while (true)
- {
- string input = Console.ReadLine();
- if (input == "Stop")
- {
- break;
- }
- if (input == "sea" && seaCount != 0)
- {
- totalSum += 680;
- seaCount--;
- }
- else if (input == "mountain" && mountCount != 0)
- {
- totalSum += 499;
- mountCount--;
- }
- if (seaCount == 0 && mountCount == 0)
- {
- Console.WriteLine("Good job! Everything is sold.");
- break;
- }
- }
- Console.WriteLine($"Profit: { totalSum} leva.");
- }
- }
- }
Add Comment
Please, Sign In to add comment