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

📄 exercise3_6.java

📁 java程序设计导论(daniel liang著) 所有偶数课后习题答案
💻 JAVA
字号:
// Exercise3_6.javaimport javax.swing.*;public class Exercise3_6 {    public static void main(String[] args) {        // Prompt the user to enter an integer        int number = Integer.parseInt(JOptionPane.showInputDialog("Enter an integer:"));                if (number % 5 == 0 && number % 6 == 0)            System.out.println(number + " is divisible by both 5 and 6");        else if (number % 5 == 0 ^ number % 6 == 0)            System.out.println(number + " is divisible by both 5 and 6, but not both");        else             System.out.println(number + " is not divisible by either 5 or 6");    }  }

⌨️ 快捷键说明

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