//判断一个数的奇偶
import java.util.Scanner;
public class OddDecider{
public static void main(String[]args){
Scanner scanner=new Scanner(System.in);
System.out.print("请输入数字:");
double input = scanner.nextDouble();//将字符串转为double
double remain=input%2;
if(remain==1)
System.out.println(input+"是奇数");
else
System.out.println(input+"是偶数");
}
}
posted on 2009-03-26 09:18
鹏凌 阅读(146)
评论(0) 编辑 收藏