Advertisement
Yancho_code

Untitled

Apr 19th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _02.Football_Results
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int counterWon = 0;
  14.             int counterLost = 0;
  15.             int counterDrawn = 0;
  16.             string FirstMatch = Console.ReadLine();
  17.             string SecondMatch = Console.ReadLine();
  18.             string ThirthMatch = Console.ReadLine();
  19.  
  20.  
  21.             int FirstMatch1 = FirstMatch[0];
  22.             int SecondMatch1 = SecondMatch[0];
  23.             int ThirthMatch1 = ThirthMatch[0];
  24.             int FirstMatch2 = FirstMatch[3];
  25.             int SecondMatch2 = SecondMatch[3];
  26.             int ThirthMatch2 = ThirthMatch[3];
  27.  
  28.            
  29.             if (FirstMatch1>FirstMatch2)
  30.             {
  31.                 counterWon++;
  32.             }
  33.  
  34.             else if (FirstMatch1 < FirstMatch2)
  35.             {
  36.                 counterLost++;
  37.             }
  38.  
  39.             else
  40.             {
  41.                 counterDrawn++;
  42.             }
  43.             //
  44.             if (SecondMatch1 > SecondMatch2)
  45.             {
  46.                 counterWon++;
  47.             }
  48.  
  49.             else if (SecondMatch1 > SecondMatch2)
  50.             {
  51.                 counterLost++;
  52.             }
  53.  
  54.             else
  55.             {
  56.                 counterDrawn++;
  57.             }
  58.             //
  59.             if (ThirthMatch1 > ThirthMatch2)
  60.             {
  61.                 counterWon++;
  62.             }
  63.  
  64.             else if (ThirthMatch1 > ThirthMatch2)
  65.             {
  66.                 counterLost++;
  67.             }
  68.  
  69.             else
  70.             {
  71.                 counterDrawn++;
  72.             }
  73.  
  74.  
  75.             Console.WriteLine($"Team won {counterWon} games.");
  76.             Console.WriteLine($"Team lost {counterLost} games.");
  77.             Console.WriteLine($"Drawn games: {counterDrawn}");
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement