Main.java 405B

1234567891011121314151617
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.*;
  5. public class Main {
  6. public static void main(String[] args){
  7. int total = 0;
  8. Scanner scanner = new Scanner(System.in);
  9. System.out.println("What number");
  10. int n = scanner.nextInt();
  11. for(int i = n; i > 0; i--){
  12. total = i + total;
  13. System.out.println(total);
  14. }
  15. }
  16. }