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 OddNumber
- {
- class OddNumber
- {
- static void Main(string[] args)
- {
- uint n = uint.Parse(Console.ReadLine());
- int counter = 1;
- List<long> list = new List<long>();
- for (int i = 0; i < n; i++)
- {
- long num = long.Parse(Console.ReadLine());
- list.Add(num);
- }
- for (int j = 0; j < n; j++)
- {
- for (int i = 1; i < list.Count; i++)
- {
- if (list[0] == list[i])
- {
- counter++;
- }
- }
- if(counter % 2 !=0 || counter == 1)
- {
- Console.WriteLine(list[0]);
- break;
- }
- list.Remove(list[0]);
- counter = 1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement