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

📄 ex2_11.java

📁 Introduction to java programming 一书中所有编程练习部分的源码
💻 JAVA
字号:
import javax.swing.JOptionPane;/* * To change this template, choose Tools | Templates * and open the template in the editor. *//** * * @author xiaolei */public class EX2_11 {    public static void main(String[] args) {        int num;        num = Integer.parseInt(JOptionPane.showInputDialog("输入整数:"));        System.out.println("Is " + num + " divided by 5 and 6? " +                 ((num % 5 == 0)&&(num % 6 ==0)));        System.out.println("Is " + num + " divided by 5 or 6? " +                ((num % 5 == 0)||(num % 6 ==0)));        System.out.println("Is " + num + " divided by 5 or 6, but not both? " +                 (((num % 5 == 0)||(num % 6 ==0))&&((num % 5 != 0)||(num % 6 !=0))));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -