Scanner a=new Scanner(System.in);
System.out.println("请输入数字");
int b=a.nextInt();
if(b%2==0)
{
System.out.println("您输入的是偶数");
}
else
{
System.out.println("您输入的是奇数");
}
int a=1;
int b=2;
String z;
System.out.println("a="+a+"b="+b);
z=a==b?"相等":"不相等,较大的是"+(a>b?a:b);
System.out.println(z);
时间: 2024-10-09 07:08:41