fbinnzhivko

Engoded answer 2

Apr 22nd, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         string result = null;
  8.         int a = 0;
  9.         int b = 0;
  10.         int c = 0;
  11.         int d = 0;
  12.         for (int i = 0; i < n; i++)
  13.         {
  14.             string answer;
  15.  
  16.             long das = long.Parse(Console.ReadLine());
  17.  
  18.             if (das % 4 == 2)
  19.             {
  20.                 c++;
  21.                 answer = "c ";
  22.             }
  23.             else if (das % 4 == 3)
  24.             {
  25.                 d++;
  26.                 answer = "d ";
  27.             }
  28.             else if (das % 4 == 0)
  29.             {
  30.                 a++;
  31.                 answer = "a ";
  32.             }
  33.             else
  34.             {
  35.                 b++;
  36.                 answer = "b ";
  37.             }
  38.             result = result + answer;
  39.         }
  40.         Console.WriteLine("{0}", result);
  41.         Console.WriteLine("Answer A: {0}", a);
  42.         Console.WriteLine("Answer B: {0}", b);
  43.         Console.WriteLine("Answer C: {0}", c);
  44.         Console.WriteLine("Answer D: {0}", d);
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment