Candy Game
by PoLitu_72
A2351
English
Language
Contribute a translation- Time limit
- 1000 ms
- Memory limit
- 256 MB
- Submissions
- 2
- Correct
- 2
- Solved by
- 2
- AC rate
- 100.000%
Translated by _junick.
Statement
Joe and Dave are playing a game with $N$ candies placed on a table.
Starting with Joe, they take turns taking one candy at a time.
The player who has no candy left to take loses the game, and the player who takes the last candy wins.
Given the number of candies $N$, write a program that determines who wins the game.
Input
The first line contains the number of candies, $N$. ($1 \le N \le 100\,000$)
Output
Print J if Joe wins, and D if Dave wins.
Examples
Sample input 1
5
Sample output 1
J
Sample input 2
2
Sample output 2
D
In these problemsets
Credits
- Writer: PoLitu_72