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

📄 halfdollars.java

📁 21Java教程的全部源代码 北京邮电大学出版
💻 JAVA
字号:
class HalfDollars {
    public static void main(String[] arguments) {
        int[] denver = { 15000006, 18810000, 20752110 };
        int[] philadelphia = new int[denver.length];
        int[] total = new int[denver.length];
        int average;

        philadelphia[0] = 15020000;
        philadelphia[1] = 18708000;
        philadelphia[2] = 21348000;

        total[0] = denver[0] + philadelphia[0];
        total[1] = denver[1] + philadelphia[1];
        total[2] = denver[2] + philadelphia[2];
        average = (total[0] + total[1] + total[2]) / 3;

        System.out.println("1993 production: " + total[0]);
        System.out.println("1994 production: " + total[1]);
        System.out.println("1995 production: " + total[2]);
        System.out.println("Average production: "+ average);
    }
}

⌨️ 快捷键说明

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