|
@@ -1,9 +1,26 @@
|
|
1
|
+import java.util.Scanner;
|
|
2
|
+
|
1
|
3
|
/**
|
2
|
4
|
* Created by iyasuwatts on 10/17/17.
|
3
|
5
|
*/
|
4
|
6
|
public class Main {
|
5
|
|
-
|
6
|
7
|
public static void main(String[] args){
|
|
8
|
+ int n = 8;
|
|
9
|
+ int tally = 0;
|
7
|
10
|
|
|
11
|
+
|
|
12
|
+ System.out.println("Input a number: ");
|
|
13
|
+
|
|
14
|
+ Scanner input = new Scanner (System.in);
|
|
15
|
+ n = input.nextInt();
|
|
16
|
+
|
|
17
|
+ for (int i=0; i<=n; i++){
|
|
18
|
+ tally += i;
|
|
19
|
+ System.out.println(tally);
|
|
20
|
+ }
|
8
|
21
|
}
|
9
|
22
|
}
|
|
23
|
+/*
|
|
24
|
+ * * Write a program which prompts the user to input a number, `n`.
|
|
25
|
+ * The program should respond by printing the sum of the numbers 1 to `n`.
|
|
26
|
+ */
|