Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TournamentOfChristmas
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int winTotal = 0;
- int loseTotal = 0;
- double totalSum = 0;
- for (int i = 0; i < days; i++)
- {
- int win = 0;
- int lose = 0;
- double sum = 0;
- while (true)
- {
- string command = Console.ReadLine();
- if (command == "win")
- {
- sum += 20;
- win++;
- }
- else if (command == "lose")
- {
- lose++;
- }
- else if (command == "Finish")
- {
- if (win > lose)
- {
- totalSum += sum * 1.1;
- winTotal += win;
- }
- else
- {
- totalSum += sum;
- loseTotal += lose;
- }
- break;
- }
- }
- }
- if (winTotal > loseTotal)
- {
- Console.WriteLine($"You won the tournament! Total raised money: {totalSum * 1.2:F2}");
- }
- else
- {
- Console.WriteLine($"You lost the tournament! Total raised money: {totalSum:F2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement