Advertisement
spasnikolov131

Untitled

Jun 23rd, 2022
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2. using System.Linq.Expressions;
  3.  
  4. namespace Add_Bags
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int maximumGoals = Int32.MinValue;
  11. string bestPlayer = string.Empty;
  12.  
  13. int totalGoals = 0;
  14.  
  15. while (true)
  16. {
  17. string line = Console.ReadLine();
  18. if (line == "END")
  19. {
  20. Console.WriteLine($"{bestPlayer} is the best player!");
  21. Console.WriteLine($"He has scored {totalGoals} goals.");
  22. break;
  23. }
  24.  
  25. int countGoals = int.Parse(Console.ReadLine());
  26. if (countGoals >= maximumGoals)
  27. {
  28. totalGoals = maximumGoals;
  29. }
  30.  
  31.  
  32.  
  33. }
  34.  
  35.  
  36.  
  37. Console.WriteLine($"{bestPlayer} is the best player!");
  38. Console.WriteLine("He has scored {брой голове} goals and made a hat-trick !!!");
  39. Console.WriteLine("He has scored {брой голове} goals.");
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement