123456789101112131415161718192021222324
  1. import java.util.*;
  2. public class Main {
  3. public static void main(String[] args){
  4. Scanner input = new Scanner(System.in);
  5. System.out.println("Please Type In a Number: ");
  6. int n = input.nextInt();
  7. int j = 0;
  8. //double x;
  9. // if (n % 2 == 0){
  10. // x = (n/2)*(n+1);
  11. // n = x;
  12. // }
  13. for (int i = 1; i <= n; i++){
  14. j = i + j;
  15. }
  16. System.out.println(j);
  17. }
  18. }