?? sum.java
字號:
// Sum Java class// This sample reads a bunch of integers entered as command line arguments// sums them up and prints the sum and average.public class Sum { public static void main( String nums[] ) { // create an int array of the right size int[] ivals = new int[nums.length]; // convert each string to integer for (int i=0;i<nums.length;i++) { ivals[i]= Integer.parseInt(nums[i]); } // sum everything up int total=0; for (int i=0;i<ivals.length;i++) { total += ivals[i]; } System.out.println("Sum is " + total); }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -