Advertisement
bpavlov123bp

EncodedAnswers

May 3rd, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace EncodedAnswers
  5. {
  6. class Program
  7. {
  8. public static void Main(string[] args)
  9. {
  10. var n = int.Parse(Console.ReadLine());
  11. var countA = 0;
  12. var countB = 0;
  13. var countC = 0;
  14. var countD = 0;
  15. List<char> letters = new List<char>();
  16. for(var i = 1; i <= n; i++)
  17. {
  18. long answers = long.Parse(Console.ReadLine());
  19. if(answers % 4 == 0)
  20. {
  21. countA++;
  22. letters.Add('a');
  23. }
  24. if(answers % 4 == 1)
  25. {
  26. countB++;
  27. letters.Add('b');
  28. }
  29. if(answers % 4 == 2)
  30. {
  31. countC++;
  32. letters.Add('c');
  33. }
  34. if(answers % 4 == 3)
  35. {
  36. countD++;
  37. letters.Add('d');
  38. }
  39. }
  40. foreach (var elements in letters) {
  41. Console.Write("{0} ", elements);
  42. }
  43. Console.WriteLine();
  44. Console.WriteLine("Answer A: {0}", countA);
  45. Console.WriteLine("Answer B: {0}", countB);
  46. Console.WriteLine("Answer C: {0}", countC);
  47. Console.WriteLine("Answer D: {0}", countD);
  48. Console.Write("Press any key to continue . . . ");
  49. Console.ReadKey(true);
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement