12345678910111213141516171819202122 |
- /**
- * Created by Mexi 05/29/2018.
- */
- import java.util.Scanner;
- import java.lang.Math;
- public class Main {
-
- public static void main(String[] args){
- Scanner in = new Scanner(System.in);
- System.out.println("Please input a number!");
- int n = Integer.parseInt(in.nextLine());
- int sum = 0;
- for (int i=0;i<=n;i++){
- sum = sum +i;
-
- }
- System.out.println(sum);
-
-
- }
- }
|