Main.java 423B

123456789101112131415161718
  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 sumOfNumbers = 0;
  8. Scanner in = new Scanner(System.in);
  9. System.out.print("Gimme number pls!\n");
  10. int n = in.nextInt();
  11. for (int i = 1; i <= n; i++) {
  12. sumOfNumbers += i;
  13. }
  14. System.out.println(sumOfNumbers);
  15. }
  16. }