View difference between Paste ID: pkd3YQJ9 and pEJT75wv
SHOW: | | - or go back to the newest paste.
1
using System;
2
3
namespace ChristmasGifts
4
{
5
    class Program
6
    {
7
        static void Main(string[] args)
8
        {
9
            int days = int.Parse(Console.ReadLine());
10
11
            double money = 0.0;
12
            int dayWon = 0;
13
            int dayLost = 0;
14
15
            for (int i = 1; i <= days; i++){
16
                double dailyMoney = 0.0;
17
                int win = 0;
18
                int lose = 0;
19
20
                while (true){
21
                    string sport = Console.ReadLine();
22
23
                    if (sport == "Finish"){
24
                        break;
25
                    }
26
27
                    string result = Console.ReadLine();
28
29
                    if (result == "win"){
30
                        win += 1;
31
                        dailyMoney += 20;
32
                    }
33-
                    else
33+
                    else{
34-
                    {
34+
35
                    }
36
                }
37
                if (win > lose){
38
                    dailyMoney *= 1.1;
39
                    dayWon += 1;
40
                }
41
                else{
42-
                else
42+
43-
                {
43+
44
                money += dailyMoney;
45
            }
46
            if (dayWon > dayLost){
47
                Console.WriteLine($"You won the tournament! Total raised money: {money * 1.2:f2}");
48
            }
49
            else{
50
                Console.WriteLine($"You lost the tournament! Total raised money: {money:f2}");
51-
            else
51+
52-
            {
52+
53
    }
54
}