Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int days =int.Parse(Console.ReadLine()); // Read that number from console.
- double totalMoneyWon = 0;
- int totalDaysYourAreWinner = 0;
- int totalDaysYouAreLoser = 0;
- for (int i = 0; i < days; i++)
- {
- string command = Console.ReadLine(); // Read that string from console.
- int gamesWonForADay = 0;
- int gamesLostForADay = 0;
- while (command != "Finish")
- {
- string sport = Console.ReadLine();// Read that string from console.
- string outcome = Console.ReadLine(); // Read that string from console.
- if (outcome == "win")
- {
- gamesWonForADay++;
- }
- else
- {
- gamesLostForADay++;
- }
- command = Console.ReadLine(); // Read that string from console.
- }
- double moneyWonForADay = gamesWonForADay * 20;
- if (gamesWonForADay > gamesLostForADay)
- {
- totalDaysYourAreWinner++;
- moneyWonForADay += (moneyWonForADay * 0.10) ;
- }
- else
- {
- totalDaysYouAreLoser++;
- }
- totalMoneyWon += moneyWonForADay;
- }
- if (totalDaysYourAreWinner > totalDaysYouAreLoser)
- {
- totalMoneyWon = totalMoneyWon + (totalMoneyWon* 0.2);
- Console.WriteLine($"You won the tournament! Total raised money: {totalMoneyWon}");
- }
- else
- {
- Console.WriteLine($"You lost the tournament! Total raised money: {totalMoneyWon}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement