Advertisement
spasnikolov131

Untitled

Jun 23rd, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 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.  
  22. if (maximumGoals >= 3)
  23. {
  24. Console.WriteLine($"He has scored {maximumGoals} goals and made a hat-trick !!!");
  25. return;
  26. }
  27. else
  28. {
  29. Console.WriteLine($"{bestPlayer} has scored {maximumGoals} goals.");
  30. }
  31. }
  32. if (maximumGoals >= 10)
  33. {
  34. Console.WriteLine($"He has scored {maximumGoals} goals and made a hat-trick !!!");
  35. break;
  36. }
  37.  
  38. {
  39. int countGoals = int.Parse(Console.ReadLine());
  40. bestPlayer = line;
  41. if (countGoals > maximumGoals)
  42. {
  43. bestPlayer = line;
  44. maximumGoals = countGoals;
  45. }
  46. }
  47.  
  48.  
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement