Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BestPlayer
- {
- class Program
- {
- public static void Main()
- {
- string bestPlayer = "";
- int playerGoals = 0;
- string command = Console.ReadLine();
- while (command != "END" && playerGoals < 10)
- {
- string currentPlayer = command;
- int currentGoals = int.Parse(Console.ReadLine());
- if (currentGoals > playerGoals)
- {
- bestPlayer = currentPlayer;
- playerGoals = currentGoals;
- }
- command = Console.ReadLine();
- }
- Console.WriteLine($"{bestPlayer} is the best player!");
- if (playerGoals < 3)
- {
- Console.WriteLine($"He has scored {playerGoals} goals.");
- }
- else
- {
- Console.WriteLine($"He has scored {playerGoals} goals and made a hat-trick !!!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement