Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06.TournamentOfChristmas
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- double totalWinsPerDay = 0;
- int totalWinsCounter = 0;
- int totalLosesCounter = 0;
- for (int i = 1; i <= days; i++)
- {
- double winsPerDay = 0;
- int winsCounterPerDay = 0;
- int losesCounterPerDay = 0;
- string sport = Console.ReadLine();
- while (sport != "Finish")
- {
- string winOrLose = Console.ReadLine();
- if (winOrLose == "win")
- {
- winsPerDay += 20;
- totalWinsCounter++;
- winsCounterPerDay++;
- }
- else if (winOrLose == "lose")
- {
- totalLosesCounter++;
- losesCounterPerDay++;
- }
- sport = Console.ReadLine();
- }
- if (winsCounterPerDay > losesCounterPerDay)
- {
- winsPerDay *= 1.10;
- totalWinsPerDay += winsPerDay;
- winsCounterPerDay = 0;
- }
- else
- {
- totalWinsPerDay += winsPerDay;
- losesCounterPerDay = 0;
- }
- }
- if (totalWinsCounter > totalLosesCounter)
- {
- totalWinsPerDay *= 1.20;
- Console.WriteLine($"You won the tournament! Total raised money: {totalWinsPerDay:f2}");
- }
- else
- {
- Console.WriteLine($"You lost the tournament! Total raised money: {totalWinsPerDay:f2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement