主题:[讨论]java简单程序出错检查
import java.util.Scanner;
public class compare
{
public static void main(String[] args)
{
Scanner scanner=new Scanner(System.in);
System.out.println("请输入数字:");
int n=scanner.nextInt();
System.out.println("是否为奇数?"+((n%2)!=0?'是':'不是'));
}
}
public class compare
{
public static void main(String[] args)
{
Scanner scanner=new Scanner(System.in);
System.out.println("请输入数字:");
int n=scanner.nextInt();
System.out.println("是否为奇数?"+((n%2)!=0?'是':'不是'));
}
}