Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- class GFG
- {
- public static void Main()
- {
- var games = int.Parse(Console.ReadLine());
- var totalWins = 0;
- var totalLoses = 0;
- var totalSum = 0.0;
- for (int i = 0; i < games; i++)
- {
- var wins = 0;
- var loses = 0;
- var daySum = 0.0;
- do
- {
- var terminate = Console.ReadLine();
- if (terminate == "Finish") { break; }
- var other= Console.ReadLine();
- if (other=="win")
- {
- wins++;
- }
- else
- {
- loses++;
- }
- } while (true);
- if (wins>loses)
- {
- daySum += 20 * wins;
- daySum += daySum * 0.1;
- totalWins++;
- }
- else
- {
- daySum += 20 * wins;
- totalLoses++;
- }
- totalSum += daySum;
- }
- if (totalWins>totalLoses)
- {
- totalSum+= totalSum * 0.2;
- Console.WriteLine($"You won the tournament! Total raised money: {totalSum:f2}");
- }
- else
- {
- Console.WriteLine($"You lost the tournament! Total raised money: {totalSum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement