nikolayneykov

Untitled

Oct 7th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Best_player_4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double max = double.MinValue;
  14.             string best = string.Empty;
  15.             string name = string.Empty;
  16.             while ((name = Console.ReadLine()) != "END")
  17.             {
  18.                 int goals = int.Parse(Console.ReadLine());
  19.                 if (goals > max)
  20.                 {
  21.                     max = goals;
  22.                     best = name;
  23.                 }
  24.                 if (max >= 10)
  25.                 {
  26.                     Console.WriteLine($"{best} is the best player!");
  27.  
  28.                     Console.WriteLine($"He has scored {max} goals and made a hat-trick !!!");
  29.                     break;
  30.                 }
  31.  
  32.             }
  33.             if (max<10)
  34.             {
  35.                 Console.WriteLine($"{best} is the best player!");
  36.  
  37.                 if (max >= 3 && max < 10)
  38.                 {
  39.                     Console.WriteLine($"He has scored {max} goals and made a hat-trick !!!");
  40.                 }
  41.                 else
  42.                 {
  43.                     Console.WriteLine($"He has scored {max} goals.");
  44.                 }
  45.             }
  46.            
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment