백준

[JAVA] 백준 8393번 합

DEV장화 2023. 2. 23. 17:45
728x90
반응형
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer a = scanner.nextInt();

        Integer res = 0;
        for (int i = 1; i <= a; i++) {
            res += i;
        }
        System.out.println(res);
    }
}

 

728x90
반응형