Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BasketballTournament
- {
- class Program
- {
- static void Main(string[] args)
- {
- string tournament;
- int win = 0, lost = 0;
- while ((tournament = Console.ReadLine()) != "End of tournaments")
- {
- int games = int.Parse(Console.ReadLine());
- for (int game = 1; game <= games; game++)
- {
- int team1 = int.Parse(Console.ReadLine());
- int team2 = int.Parse(Console.ReadLine());
- if (team1 > team2)
- {
- Console.WriteLine($"Game {game} of tournament {tournament}: win with {team1 - team2} points.");
- win++;
- }
- else
- {
- Console.WriteLine($"Game {game} of tournament {tournament}: lost with {team2 - team1} points.");
- lost++;
- }
- }
- }
- Console.WriteLine($"{(double)win / (win + lost) * 100:F2}% matches win");
- Console.WriteLine($"{(double)lost / (win + lost) * 100:F2}% matches lost");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement