Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Loops
- {
- class Program
- {
- static void Main(string[] args)
- {
- int tournaments = int.Parse(Console.ReadLine());
- int initialPoints = int.Parse(Console.ReadLine());
- string typeTournament = Console.ReadLine();
- int wPoints = 0;
- int fPoints = 0;
- int sfPoints = 0;
- int winnerCount = 0;
- for (int i = 1; i <= tournaments; i++)
- {
- if (typeTournament == "W")
- {
- wPoints += 2000;
- initialPoints += 2000;
- winnerCount++;
- }
- else if (typeTournament == "F")
- {
- fPoints += 1200;
- initialPoints += 1200;
- }
- else
- {
- sfPoints += 720;
- initialPoints += 720;
- }
- typeTournament = Console.ReadLine();
- }
- int winnerPoints = (wPoints + fPoints + sfPoints) / tournaments;
- double averagePoints = winnerPoints * 1.0;
- double percent = (winnerCount * 1.0 / tournaments) * 100.0;
- Console.WriteLine($"Final points: {initialPoints}");
- Console.WriteLine($"Average points: {Math.Floor(averagePoints)}");
- Console.WriteLine($"{percent:f2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement