합 (8393)

유지원·2021년 6월 23일
0

백준OJ

목록 보기
19/32
post-thumbnail

Java 11

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {

        int n = Integer.parseInt(new BufferedReader(new InputStreamReader(System.in)).readLine());
        int s = 0;

        for (int i = 1; i<= n; i++) {
            s += i;
        }

        System.out.println(s);
    }
}
profile
👋 https://github.com/ujw0712

0개의 댓글