Advertisement
bomman

Untitled

Oct 21st, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. class Program
  6. {
  7.     static void Main(string[] args)
  8.     {
  9.         List<string> input = Console.ReadLine().Split(' ').ToList();
  10.         List<string> distincted = input.Distinct().ToList();
  11.  
  12.         for (int i = 0; i < distincted.Count; i++)
  13.         {
  14.             for (int d = 0; d < input.Count; d++)
  15.             {
  16.                 if (distincted[i] == input[d] )
  17.                 {
  18.                     Console.Write("{0} ", input[d]);
  19.                 }
  20.             }
  21.             Console.WriteLine();
  22.         }
  23.  
  24.  
  25.  
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement