Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Best_player_4
- {
- class Program
- {
- static void Main(string[] args)
- {
- double max = double.MinValue;
- string best = string.Empty;
- string name = string.Empty;
- while ((name = Console.ReadLine()) != "END")
- {
- int goals = int.Parse(Console.ReadLine());
- if (goals > max)
- {
- max = goals;
- best = name;
- }
- if (max >= 10)
- {
- Console.WriteLine($"{best} is the best player!");
- Console.WriteLine($"He has scored {max} goals and made a hat-trick !!!");
- break;
- }
- }
- if (max<10)
- {
- Console.WriteLine($"{best} is the best player!");
- if (max >= 3 && max < 10)
- {
- Console.WriteLine($"He has scored {max} goals and made a hat-trick !!!");
- }
- else
- {
- Console.WriteLine($"He has scored {max} goals.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment