📄 checknumber.java
字号:
package checknumber;
import java.util.*;
public class CheckNumber {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
System.out.print("enter a number:");
int i=scanner.nextInt();
if((i%5==0)&&(i%6==0))
System.out.println("i is divisible by both 5 and 6.");
else System.out.println("error!");
System.out.print("enter a number:");
int j=scanner.nextInt();
if((j%5==0)||(j%6==0))
System.out.println("j is divisible either 5 or 6.");
else System.out.println("error!");
System.out.print("enter a number:");
int k=scanner.nextInt();
if(((k%5==0)&&(k%6!=0))||((k%5!=0)&&(k%6==0)))
System.out.println("k is divisible by 5 or 6,but not both.");
else System.out.print("error!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -