数字6

程序要求:

数字6是一个真正伟大的数字,键盘录入两个整数。

如果其中一个为6,最终结果输出ture。

如果它们的和为6的倍数,最终结果输出也为ture。

其它情况都是false。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package hello;

import java.util.Scanner;

public class text2 {
public static void main(String[] args) {
System.out.println("输入两个数字");
Scanner sc = new Scanner(System.in);
int num1=sc.nextInt();
int num2= sc.nextInt();
System.out.println((num2+num1)%6==0||num2==6||num1==6);
}
}

更新于

请我喝[茶]~( ̄▽ ̄)~*

罗梓丰 微信支付

微信支付

罗梓丰 支付宝

支付宝