欢迎各位大佬指正缺点
import java.util.Scanner;
public class homework8 {
public static void main(String[] args) {
// 输入一个正整数判断奇偶;
Scanner input = new Scanner (System.in);
System.out.print("请输入一个正整数");
int a =input.nextInt();
int b = a % 2;
switch (b) {
case 0:
System.out.println("偶数");
break;
case 1:
System.out.println("奇数");
break;
}input.close();
}
}