public class JiOu { public static void main(String[] args) { int a = 11; System.out.println("这个数是" + (a % 2 == 0?"偶数":"奇数")); int b = 11; if (b % 2 ==0) { System.out.println("这个数为偶数"); } else { System.out.println("这个数是奇数"); } int c = 12; switch (c % 12) { case 0 : System.out.println("这个数是偶数"); break; default: System.out.println("这个数是奇数"); break; } } }