Advertisement
MayaIP

Untitled

Jun 5th, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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 _08.PrimeNumberCheck
  8. {
  9. class PrimeNumberCheck
  10. {
  11. static void Main(string[] args)
  12. {
  13. char a = char.Parse(Console.ReadLine());
  14. char b = char.Parse(Console.ReadLine());
  15. int n = int.Parse(Console.ReadLine());
  16. int aM = 0;
  17. int bM = 0;
  18. for (int i = 1; i <= n; i++)
  19. {
  20. string steps = Console.ReadLine();
  21.  
  22. if (steps == "UPGRADE")
  23. {
  24. a += (char)3;
  25. b += (char)3;
  26. }
  27. else if (i % 2 == 0)
  28. {
  29. bM += steps.Length;
  30. }
  31. else
  32. {
  33. aM += steps.Length;
  34. }
  35. if (aM >= 50 || bM >= 50)
  36. break;
  37. }
  38. if (aM > bM)
  39. {
  40. Console.WriteLine(a);
  41. }
  42. else
  43. {
  44. Console.WriteLine(b);
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement