Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace FootballResults
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int winCount = 0;
  12.             int drawnCount = 0;
  13.             int lostCount = 0;
  14.  
  15.  
  16.             for (int i = 0; i < 3; i++)
  17.             {
  18.                 List<int> result = Console.ReadLine().Split(":").Select(int.Parse).ToList();
  19.                 if (result[0]>result[1])
  20.                 {
  21.                     winCount++;
  22.                 }
  23.                 if (result[0]<result[1])
  24.                 {
  25.                     lostCount++;
  26.                 }
  27.                 if (result[0] == result[1])
  28.                 {
  29.                     drawnCount++;
  30.                 }
  31.                
  32.             }
  33.             Console.WriteLine($"Team won {winCount} games.");
  34.             Console.WriteLine($"Team lost {lostCount} games.");
  35.             Console.WriteLine($"Drawn games: {drawnCount}");
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement