[odd or even] Java编程【odd or even】White an application that reads two interger and determines and prints whether it's odd erven

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/27 15:02:41
[odd or even] Java编程【odd or even】White an application that reads two interger and determines and prints whether it's odd erven
xRJBQ= 4ڦk|˝QܷMG7.g Ds̙s ^e(#xʾ+u?o1mABМ)謄q2dl`z}PI}k; m 3|{/umT Ԯ &a&jC*;}4

[odd or even] Java编程【odd or even】White an application that reads two interger and determines and prints whether it's odd erven
[odd or even] Java编程
【odd or even】White an application that reads two interger and determines and prints whether it's odd erven

[odd or even] Java编程【odd or even】White an application that reads two interger and determines and prints whether it's odd erven
public class Test
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.println("Please input the first integer!");
int a = s.nextInt();
if(a % 2 == 0)
{
System.out.println(a + " is even!");
}
else
{
System.out.println(a + " is odd!");
}
System.out.println("Please input the first integer!");
int b = s.nextInt();
if(b % 2 == 0)
{
System.out.println(b + " is even!");
}
else
{
System.out.println(b + " is odd!");
}
}
}