Created
May 3, 2015 10:01
-
-
Save alagalia/8f0b87dd9fa72b73616c to your computer and use it in GitHub Desktop.
04SequencesEqualStrings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
class Program | |
{ | |
static void Main() | |
{ | |
List <string> input = new List<string> (Console.ReadLine().Split()); | |
for (int i = 0; i < input.Count; i++) | |
{ | |
if (i<input.Count-1) | |
{ | |
for (int j = i+1; j < input.Count; j++) | |
{ | |
if (input[i]== input[j]) | |
{ | |
Console.Write(input[j]+ " "); | |
input.RemoveAt(j); | |
j--; | |
} | |
} | |
} | |
Console.Write(input[i]); | |
Console.WriteLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment