Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05.TennisRanklist
- {
- class TennisRanklist
- {
- static void Main(string[] args)
- {
- double tours = double.Parse(Console.ReadLine());
- double points = double.Parse(Console.ReadLine());
- double newPoints = 0;
- double allPoints = 0;
- double average = 0;
- double win = 0;
- double percent = 0;
- for (int i = 1; i <= tours; i++)
- {
- string level = Console.ReadLine();
- if (level == "W")
- {
- newPoints += 2000;
- win++;
- }
- else if (level == "F")
- {
- newPoints += 1200;
- }
- else if (level == "SF")
- {
- newPoints += 720;
- }
- allPoints = newPoints + points;
- average = Math.Floor(newPoints / tours);
- percent = (win / tours) * 100;
- //Console.WriteLine(win);
- //Console.WriteLine(percent);
- }
- Console.WriteLine($"Final points: {allPoints}");
- Console.WriteLine($"Average points: {average}");
- Console.WriteLine($"{percent:f2}%");
- }
- }
- }
Add Comment
Please, Sign In to add comment