Advertisement
vasilivanov93

Untitled

Mar 13th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _17.CypherRoulette
  4. {
  5. public class CypherRoulette
  6. {
  7. public static void Main()
  8. {
  9. {
  10. uint inputRows = uint.Parse(Console.ReadLine());
  11.  
  12. string cypherString = "", currString, prevString = "";
  13. string concatMode = "NormalMode";
  14.  
  15. while (inputRows > 0)
  16. {
  17. currString = Console.ReadLine();
  18.  
  19. if (prevString == currString)
  20. {
  21. cypherString = string.Empty;
  22.  
  23. if (prevString != "spin")
  24. inputRows--;
  25.  
  26. continue;
  27. }
  28.  
  29. if (currString != "spin")
  30. inputRows--;
  31.  
  32. else
  33. {
  34. if (concatMode == "SpinMode")
  35. concatMode = "NormalMode";
  36.  
  37. else
  38. concatMode = "SpinMode";
  39.  
  40. prevString = currString;
  41. continue;
  42. }
  43.  
  44. switch (concatMode)
  45. {
  46. case ("NormalMode"):
  47. cypherString = cypherString + currString;
  48. break;
  49.  
  50. case ("SpinMode"):
  51. cypherString = currString + cypherString;
  52. break;
  53. }
  54.  
  55. prevString = currString;
  56.  
  57. }
  58. Console.WriteLine(cypherString);
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement