Advertisement
Stann

OddNumberVer2

Mar 31st, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. class Test
  4. {
  5.     static void Main()
  6.     {
  7.         uint n = uint.Parse(Console.ReadLine());
  8.         List<long> nums = new List<long>();
  9.  
  10.         for (int i = 0; i < n; i++)
  11.         {
  12.             long num = long.Parse(Console.ReadLine());
  13.             nums.Add(num);
  14.         }
  15.         nums.Sort();
  16.         for (int i = 0; i < nums.Count - 1; i++)
  17.         {
  18.             if (nums[i] == nums[i + 1])
  19.             {
  20.                 nums.Remove(nums[i + 1]);
  21.                 nums.Remove(nums[i]);
  22.                 i--;
  23.             }
  24.         }
  25.         foreach (long num in nums)
  26.         {
  27.             Console.WriteLine(num);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement