Odd Even Game
Time limit1sMemory limit1024 MB
Count the even and odd digits of a given N-digit number K and print 0 if evens are more, 1 if odds are more, or -1 if they are equal.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Minku wants to play an odd-even game with a positive integer that has digits.
The odd-even game goes as follows.
- For each digit, check whether the digit is even or odd. The digit is even.
- After every digit has been checked, compare the number of even digits with the number of odd digits.
- If there are more even digits than odd digits, the given number is an even-even number. If there are more odd digits than even digits, it is an odd-odd number.
Minku has trouble counting the digits of a very long number, so write a program that plays the game for him.
Input
The first line contains the number of digits .
The second line contains a natural number .
The positive integer never begins with .
Output
Print if the given natural number is an even-even number, if it is an odd-odd number, and if it is neither.