happy coding

[java] 8393.합구하기 본문

coding study/baekjoon

[java] 8393.합구하기

yeoonii 2023. 4. 4. 19:50
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());

        int t = Integer.parseInt(br.readLine());
        int sum = 0;

        for (int i=0;i<=t;i++) {
            sum = sum + i;
        }

        System.out.println(sum);

        //int a = Integer.parseInt(br.readLine());

    }
}

'coding study > baekjoon' 카테고리의 다른 글

[java] 10951.a+b-4  (0) 2023.04.05
[java] 10952.a+b-5  (0) 2023.04.05
[java] 10950.a+b-3  (0) 2023.04.04
[java] 10869.사칙연산  (0) 2023.04.03
[c] 9498번. 시험성적  (0) 2022.12.24
Comments