#CCBCHMUOI0000006. Tính chẵn lẻ bằng switch (Parity Using Switch)
Tính chẵn lẻ bằng switch (Parity Using Switch)
Parity Using Switch
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a non-negative integer n, determine whether it is even or odd using a selection on its remainder modulo 2.
Input
One line contains a non-negative integer n.
Output
Print EVEN when n is even, otherwise ODD.
Subtasks
-
Subtask 1 (20 points): 0 <= n <= 9.
-
Subtask 2 (30 points): 0 <= n <= 1000.
-
Subtask 3 (50 points): 0 <= n <= 10^9.
Examples
Example 1
Input
0
Output
EVEN
Explanation
0 modulo 2 is zero, so case 0 prints EVEN.
Example 2
Input
17
Output
ODD
Explanation
17 = 2*8 + 1, so the remainder is 1 and case 1 prints ODD.