Advertisement
petarkobakov

Football results PB

Mar 1st, 2020
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Football_results_2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int win = 0;
  10. int loss = 0;
  11. int drawn = 0;
  12.  
  13. for (int game = 1; game <= 3; game++)
  14. {
  15. string result = Console.ReadLine();
  16. char score1 = result[0];
  17. char score2 = result[2];
  18. if (score1 > score2)
  19. {
  20. win++;
  21. }
  22. else if (score1 < score2)
  23. {
  24. loss++;
  25. }
  26. else if (score1 == score2)
  27. {
  28. drawn++;
  29.  
  30. }
  31. }
  32. Console.WriteLine($"Team won {win} games.");
  33. Console.WriteLine($"Team lost {loss} games.");
  34. Console.WriteLine($"Drawn games: {drawn}");
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement