1234567891011121314151617181920212223 |
- import java.util.*;
- /**
- * Created by jaejoson
- */
- public class Main {
-
- public static void main(String[] args){
- Scanner in = new Scanner(System.in);
- System.out.println("Type in a number");
- double n = in.nextDouble();
- double sum = 0;
-
- while (n > 0) {
- sum = sum + n;
- n = n - 1;
- }
-
- System.out.println("Total sum of input is " + sum);
-
-
- }
- }
|