TQC+ JAVA 203 判斷奇偶數
import java.util.*;
public class JPA02 {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
}
static void test() {
System.out.println("Input an integer:");
int a=input.nextInt();
if(a%2==0)
System.out.println("The number is even.");
else
System.out.println("The number is odd.");
}
}
沒有留言:
張貼留言