Advertisement
Guest User

personal

a guest
Apr 18th, 2023
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | Source Code | 0 0
  1. using System;
  2.  
  3. namespace _02._Football_Results
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10.  
  11. string Match = (Console.ReadLine());
  12. int wins = 0;
  13. int lose = 0;
  14. int draw = 0;
  15. for (int i = 0; i <= 2; i++)
  16. {
  17. char result = Match[(int)0];
  18. char result2 = Match[(int)2];
  19. if (result > result2)
  20. {
  21. wins++;
  22. }
  23. else if (result < result2)
  24. {
  25. lose++;
  26. }
  27. else if (result == result2)
  28. {
  29. draw++;
  30. }
  31. if (i == 2)
  32. {
  33. break;
  34. }
  35. Match = (Console.ReadLine());
  36. }
  37.  
  38. Console.WriteLine($"Team won {wins} games.");
  39. Console.WriteLine($"Team lost {lose} games.");
  40. Console.WriteLine($"Drawn games: {draw}");
  41.  
  42. }
  43. }
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement