Advertisement
manianchestera

Untitled

Aug 25th, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace EncodeAnswers
  5. {
  6. class Program
  7. {
  8. static void Main()
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. int countA = 0;
  12. int countB = 0;
  13. int countC = 0;
  14. int countD = 0;
  15. string result=null;
  16.  
  17. for (int i = 0; i < n; i++)
  18. {
  19.  
  20. string answer;
  21.  
  22. uint numbers = uint.Parse(Console.ReadLine());
  23.  
  24. if(numbers%4==0)
  25. {
  26. countA++;
  27. answer = "a";
  28. }
  29. else if(numbers%4==1)
  30. {
  31. countB++;
  32. answer = "b";
  33. }
  34. else if(numbers%4==2)
  35. {
  36. countC++;
  37. answer = "c";
  38. }
  39. else
  40. {
  41. countD++;
  42. answer = "d";
  43. }
  44. result += answer + ' ';
  45. }
  46.  
  47. Console.WriteLine(result);
  48. Console.WriteLine("Answer A: {0}",countA);
  49. Console.WriteLine("Answer B: {0}",countB);
  50. Console.WriteLine("Answer C: {0}",countC);
  51. Console.WriteLine("Answer D: {0}",countD);
  52.  
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement