Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.1 kB
0
Indexable
Never
using System;

class Program
{
    static void Main()
    {
        int tournaments = int.Parse(Console.ReadLine());
        int startingPoints = int.Parse(Console.ReadLine());

        int totalPoints = startingPoints;
        int wins = 0;

        for (int i = 0; i < tournaments; i++)
        {
            string stage = Console.ReadLine();

            if (stage == "W")
            {
                totalPoints += 2000;
                wins++;
            }
            else if (stage == "F")
            {
                totalPoints += 1200;
            }
            else if (stage == "SF")
            {
                totalPoints += 720;
            }
        }

        int averagePoints = totalPoints - startingPoints;
        averagePoints /= tournaments;

        double percentageWins = (double)wins / tournaments * 100;

        Console.WriteLine($"Final points: {totalPoints}");
        Console.WriteLine($"Average points: {averagePoints}");
        Console.WriteLine($"{percentageWins:f2}%");
    }
}
Leave a Comment