Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Distinct_List
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var numbers = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  14.            
  15.             for (int i = 0; i < numbers.Count; i++)
  16.             {
  17.                 for (int j = i+1; j < numbers.Count; j++)
  18.                 {
  19.                     if (numbers[i]==numbers[j])
  20.                     {
  21.                         numbers.RemoveAt(j);
  22.                     }
  23.                 }
  24.             }
  25.             Console.WriteLine(string.Join(" ",numbers));
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement