12345678910111213141516171819202122 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
- import java.util.Scanner;
- public class Main {
-
-
- public static void main(String[] args){
- Scanner in = new Scanner(System.in);
- System.out.print("Enter a number >0 ");
-
- int yourNumber = in.nextInt();
- int sum = 0;
- for (int i = 1; i <= yourNumber; i++){
- sum += i;
- }
- System.out.println(sum);
-
-
- }
- }
|