Main.java 466B

12345678910111213141516171819202122232425262728
  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 randomNumber = 0;
  8. Scanner input = new Scanner(System.in);
  9. System.out.println("What's your input a number");
  10. int intVar = input.nextInt();
  11. for ( int i = intVar; i>0; i--) {
  12. randomNumber = randomNumber + i;
  13. System.out.println(randomNumber);
  14. }
  15. }
  16. }