|
// Java判断奇偶数
|
|
package xiangmu;
|
|
import java.util.Scanner;
|
|
|
|
public class Ceshi {
|
|
public static void main(String args[]) {
|
|
Scanner sc = new Scanner(System.in);
|
|
dayin("请输入一个正整数:");
|
|
int shuzi = sc.nextInt();
|
|
if(shuzi % 2 == 0) {
|
|
dayin(shuzi+"是一个偶数");
|
|
}else {
|
|
dayin(shuzi+"是一个奇数");
|
|
}
|
|
sc.close();
|
|
}
|
|
public static void dayin(String zifuchuan) {
|
|
System.out.print(zifuchuan);
|
|
}
|
|
}
|