#36 Jamez-s Sum of Input

开启中
Jamez-s 请求将 2 次代码提交从 Jamez-s/ZCW-SumOfInput-BlueJ:master 合并至 master
共有 4 个文件被更改,包括 33 次插入8 次删除
  1. 二进制
      Main.class
  2. 6
    0
      Main.ctxt
  3. 20
    1
      Main.java
  4. 7
    7
      package.bluej

二进制
Main.class 查看文件


+ 6
- 0
Main.ctxt 查看文件

@@ -0,0 +1,6 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment0.text=\n\ Created\ by\ iyasuwatts\ on\ 10/17/17.\n
4
+comment1.params=args
5
+comment1.target=void\ main(java.lang.String[])
6
+numComments=2

+ 20
- 1
Main.java 查看文件

@@ -1,9 +1,28 @@
1
+import java.util.*;
1 2
 /**
2 3
  * Created by iyasuwatts on 10/17/17.
3 4
  */
4 5
 public class Main {
5 6
 
6 7
     public static void main(String[] args){
7
-
8
+        
9
+        int n, sum = 0, i =0;
10
+        Scanner sc = new Scanner(System.in);
11
+        System.out.println("Enter numbers you want to sum");
12
+        n = sc.nextInt();
13
+        int a[] = new int[n];
14
+        
15
+        System.out.println("Enter the " +n+ "numbers ");
16
+        while (i <n)
17
+        {
18
+            System.out.println("Enter number " + (i+1) +":");
19
+            a[i] = sc.nextInt();
20
+            sum += a[i];
21
+            i++;
22
+        }
23
+        System.out.println("sum is =" +sum);
8 24
     }
9 25
 }
26
+        
27
+    
28
+

+ 7
- 7
package.bluej 查看文件

@@ -1,16 +1,16 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=0
3
-editor.fx.0.width=0
4
-editor.fx.0.x=0
5
-editor.fx.0.y=0
2
+editor.fx.0.height=552
3
+editor.fx.0.width=661
4
+editor.fx.0.x=779
5
+editor.fx.0.y=39
6 6
 objectbench.height=164
7
-objectbench.width=776
7
+objectbench.width=461
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.6845018450184502
10 10
 package.editor.height=364
11 11
 package.editor.width=674
12
-package.editor.x=-816
13
-package.editor.y=445
12
+package.editor.x=100
13
+package.editor.y=100
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0