IordanRujinov

Hackerrank

Jan 22nd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 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 Hackerrank
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] AliceArray = new int[3];
  14.             int[] BobsArray = new int[3];
  15.             int[] Results = {0,0};
  16.  
  17.             for (int i = 0; i < AliceArray.Length; i++)
  18.             {
  19.                 AliceArray[i] = int.Parse(Console.ReadLine());
  20.             }
  21.  
  22.             for (int i = 0; i < BobsArray.Length; i++)
  23.             {
  24.                 BobsArray[i] = int.Parse(Console.ReadLine());
  25.             }
  26.  
  27.             for (int i = 0; i < 3; i++)
  28.             {
  29.                     if (AliceArray[i] > BobsArray[i])
  30.                     {
  31.                         Results[0] += 1;
  32.                     }
  33.                     else if (AliceArray[i] < BobsArray[i])
  34.                     {
  35.                         Results[1] += 1;
  36.                     }
  37.             }
  38.  
  39.             for (int i = 0; i < Results.Length; i++)
  40.             {
  41.                 Console.Write(Results[i] + " ");
  42.             }
  43.         }
  44.     }
  45. }
Add Comment
Please, Sign In to add comment