Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class OddNumber
- {
- static void Main()
- {
- int numbers = int.Parse(Console.ReadLine());
- int values = 0;
- int count = 0;
- int[] positive = new int[20000000];
- int[] negative = new int[20000000];
- for (int i = 0; i < numbers; i++)
- {
- values = int.Parse(Console.ReadLine());
- if (values >= 0) { positive[values]++; }
- else { values = values * (-1); negative[values]++; }
- }
- for (count = 0; count < 2000000; count++)
- {
- if (positive[count] % 2 != 0)
- {
- Console.WriteLine(count);
- break;
- }
- if (negative[count] % 2 != 0)
- {
- Console.WriteLine(-count);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement