奇偶性
Problem Description
判斷輸入的數據的奇偶性。
Input
輸入數據第一行是一個正整數N,接下來N行,每行一個正整數。
Output
對於每個輸入數據輸出一行,如果是奇數則輸出odd,否則輸出even。
Sample Input
3 2 4 5
Sample Output
even even odd
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner reader = new Scanner(System.in);
int N, x;
N = reader.nextInt();
while(N-- > 0)
{
x = reader.nextInt();
if(x % 2 == 1)
{
System.out.println("odd");
}
else
{
System.out.println("even");
}
}
reader.close();
}
}