Advertisement
Guest User

Untitled

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