⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checknumber.java

📁 包括许多JAVA程序
💻 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 + -