Advertisement
Valantina

FootballResults/EX

Jun 13th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FootballResults
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string firstResult = Console.ReadLine();
  10.             string secondResult = Console.ReadLine();
  11.             string thirdResult = Console.ReadLine();
  12.  
  13.             int firstResultLenght = firstResult.Length;
  14.             int secondResultLenght = secondResult.Length;
  15.             int thirdresultlenght = thirdResult.Length;
  16.  
  17.             int counterWins = 0;
  18.             int counterLosts = 0;
  19.             int counterDraws = 0;
  20.  
  21.             if (firstResult[0] > firstResult[2])
  22.             {
  23.                 counterWins++;
  24.             }
  25.             else if (firstResult[0] < firstResult[2])
  26.             {
  27.                 counterLosts++;
  28.             }
  29.             else if (firstResult[0] == firstResult[2])
  30.             {
  31.                 counterDraws++;
  32.             }
  33.  
  34.             if (secondResult[0] > secondResult[2])
  35.             {
  36.                 counterWins++;
  37.             }
  38.             else if (secondResult[0] < secondResult[2])
  39.             {
  40.                 counterLosts++;
  41.             }
  42.             else if (secondResult[0] == secondResult[2])
  43.             {
  44.                 counterDraws++;
  45.             }
  46.  
  47.             if (thirdResult[0] > thirdResult[2])
  48.             {
  49.                 counterWins++;
  50.             }
  51.             else if (thirdResult[0] < thirdResult[2])
  52.             {
  53.                 counterLosts++;
  54.             }
  55.             else if (thirdResult[0] == thirdResult[2])
  56.             {
  57.                 counterDraws++;
  58.             }
  59.  
  60.             Console.WriteLine($"Team won {counterWins} games.");
  61.             Console.WriteLine($"Team lost {counterLosts} games.");
  62.             Console.WriteLine($"Drawn games: {counterDraws}");
  63.  
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement