Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- double money = 0;
- double wins = 0;
- double loses = 0;
- for (int i = 1; i <= days; i++)
- {
- double moneyPerDay = 0;
- string sports = Console.ReadLine();
- double counterW = 0;
- double counterL = 0;
- while (sports != "Finish")
- {
- string result = Console.ReadLine();
- if (result == "win")
- {
- moneyPerDay += 20;
- counterW++;
- wins++;
- }
- else if (result == "lose")
- {
- counterL++;
- loses++;
- }
- sports = Console.ReadLine();
- }
- if (counterW > counterL)
- {
- money += moneyPerDay + (moneyPerDay * 0.1);
- }
- else
- {
- money += moneyPerDay;
- }
- }
- if (wins > loses)
- {
- money += money * 0.2;
- Console.WriteLine($"You won the tournament! Total raised money: {money:f2}");
- }
- else if (loses > wins)
- {
- Console.WriteLine($"You lost the tournament! Total raised money: {money:f2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement