Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace cypherRoulette
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string phrase = "";
- string word1 = "";
- string word2 = "";
- int spin = 0;
- for (int i = 0; i < n; i++)
- {
- word1 = "";
- string word = Console.ReadLine();
- word1 = word;
- if (word.Equals("spin"))
- {
- spin += 1;
- word = "";
- i -= 1;
- }
- if (spin % 2 == 0)
- {
- phrase = phrase + word;
- }
- else
- {
- phrase = word + phrase;
- }
- if (word1.Equals(word2))
- {
- phrase = "";
- }
- word2 = word1;
- }
- Console.WriteLine(phrase);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement