Untitled
unknown
plain_text
2 years ago
1.1 kB
6
Indexable
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}%");
}
}Editor is loading...
Leave a Comment