File size: 558 Bytes
c574d3a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
package torea;
import java.util.Scanner;
public class Oddities{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
sc.next();
while(sc.hasNextInt())
{
int n = sc.nextInt();
System.out.println(oddOrEven(n));
}
sc.close();
}
public static String oddOrEven(int n){
if (n%2 == 0){
return String.format("%d is even", n);
} else {
return String.format("%d is odd", n);
}
}
} |