1234567891011121314151617181920 |
- import java.util.*;
- /**
- * Created by Curtis Cook on 10/17/18.
- */
- public class Main {
-
- public static void main(String[] args){
- Scanner in = new Scanner(System.in);
- System.out.println("Please input a number.");
- int n = in.nextInt();
- int count = 0;
-
- for(int i = 1; i <= n; i++) {
- count += i;
- }
- System.out.println("The sum of numbers between 1 and " + n + " is " + count);
-
- }
- }
|