#37 completed sum of input

開啟中
sambhutani 請求將 1 次程式碼提交從 sambhutani/ZCW-SumOfInput-BlueJ:master 合併至 master
共有 4 個文件被更改,包括 28 次插入8 次删除
  1. 二進制
      Main.class
  2. 5
    0
      Main.ctxt
  3. 16
    1
      Main.java
  4. 7
    7
      package.bluej

二進制
Main.class 查看文件


+ 5
- 0
Main.ctxt 查看文件

@@ -0,0 +1,5 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+numComments=2

+ 16
- 1
Main.java 查看文件

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

+ 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=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=640
5
+editor.fx.0.y=23
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=66
13
+package.editor.y=28
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0