#30 SumOfInput

Открыто
jpsp91 хочет смерджить 1 коммит(ов) из jpsp91/ZCW-SumOfInput-BlueJ:master в master
4 измененных файлов: 31 добавлений и 12 удалений
  1. Двоичные данные
      Main.class
  2. 5
    0
      Main.ctxt
  3. 18
    4
      Main.java
  4. 8
    8
      package.bluej

Двоичные данные
Main.class Просмотреть файл


+ 5
- 0
Main.ctxt Просмотреть файл

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

+ 18
- 4
Main.java Просмотреть файл

1
-/**
2
- * Created by iyasuwatts on 10/17/17.
3
- */
1
+import java.util.*;
4
 public class Main {
2
 public class Main {
5
 
3
 
6
     public static void main(String[] args){
4
     public static void main(String[] args){
7
-
5
+        Scanner input = new Scanner(System.in);
6
+        System.out.println("Please Type In a Number: ");
7
+        int n = input.nextInt();
8
+        int j = 0;
9
+        
10
+        //double x;
11
+        
12
+        // if (n % 2 == 0){
13
+            // x = (n/2)*(n+1);
14
+            // n = x;
15
+        // }
16
+        
17
+        for (int i = 1; i <= n; i++){
18
+            j = i + j;
19
+        }
20
+        
21
+        System.out.println(j);
8
     }
22
     }
9
 }
23
 }

+ 8
- 8
package.bluej Просмотреть файл

1
 #BlueJ package file
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=250
5
+editor.fx.0.y=28
6
 objectbench.height=164
6
 objectbench.height=164
7
 objectbench.width=776
7
 objectbench.width=776
8
 package.divider.horizontal=0.6
8
 package.divider.horizontal=0.6
9
 package.divider.vertical=0.6845018450184502
9
 package.divider.vertical=0.6845018450184502
10
 package.editor.height=364
10
 package.editor.height=364
11
 package.editor.width=674
11
 package.editor.width=674
12
-package.editor.x=-816
13
-package.editor.y=445
12
+package.editor.x=46
13
+package.editor.y=223
14
 package.frame.height=600
14
 package.frame.height=600
15
 package.frame.width=800
15
 package.frame.width=800
16
 package.numDependencies=0
16
 package.numDependencies=0
28
 target1.showInterface=false
28
 target1.showInterface=false
29
 target1.type=ClassTarget
29
 target1.type=ClassTarget
30
 target1.width=80
30
 target1.width=80
31
-target1.x=70
32
-target1.y=10
31
+target1.x=230
32
+target1.y=100