import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int result = 0;
for (int i = 1; i <= N; i++) {
result += i;
}
System.out.println(result);
}
}
'알고리즘 > 문제 풀이' 카테고리의 다른 글
SW Expert Academy 1933. 간단한 N 의 약수 (0) | 2023.05.05 |
---|---|
1938 아주 간단한 계산기 (0) | 2023.05.05 |
SW Expert Academy 2027 대각선 출력하기 (0) | 2023.05.05 |
SW Expert Academy 2029 몫과 나머지 출력하기 (0) | 2023.05.05 |
SW Expert Academy 2043 서랍의 비밀번호 (0) | 2023.05.05 |