Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq.Expressions;
- namespace Add_Bags
- {
- class Program
- {
- static void Main(string[] args)
- {
- int maximumGoals = Int32.MinValue;
- string bestPlayer = string.Empty;
- int totalGoals = 0;
- while (true)
- {
- string line = Console.ReadLine();
- if (line == "END")
- {
- Console.WriteLine($"{bestPlayer} is the best player!");
- if (maximumGoals >= 3)
- {
- Console.WriteLine($"He has scored {maximumGoals} goals and made a hat-trick !!!");
- return;
- }
- else
- {
- Console.WriteLine($"{bestPlayer} has scored {maximumGoals} goals.");
- }
- }
- if (maximumGoals >= 10)
- {
- Console.WriteLine($"He has scored {maximumGoals} goals and made a hat-trick !!!");
- break;
- }
- {
- int countGoals = int.Parse(Console.ReadLine());
- bestPlayer = line;
- if (countGoals > maximumGoals)
- {
- bestPlayer = line;
- maximumGoals = countGoals;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement