문제 : N 찍기(2741번)(Bronze V)
문제 링크 : https://www.acmicpc.net/problem/2741
출처 : Baekjoon Online Judge
이번 문제는 1부터 N까지 하나씩 출력하는 문제입니다.
이전 문제보다 더 쉬운 버전입니다.
[C++]
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for(int i = 1; i <= n; i++) {
cout << i << '\n';
}
return 0;
}
[Python]
import sys
input = sys.stdin.readline
N:int = int(input().rstrip())
for i in range(1, N+1, 1) :
print(i)
'(구) solved ac class 문제들 > class 1' 카테고리의 다른 글
| [class 1]백준 시험 성적(9498번) 풀이 (C++/Python) (0) | 2026.02.08 |
|---|---|
| [class 1]백준 윤년(2753번) 풀이 (C++/Python) (0) | 2026.02.07 |
| [class 1]백준 구구단(2739번) 풀이 (C++/Python) (0) | 2026.02.06 |
| [class 1]백준 Hello World(2557번) (C++/Python) (0) | 2026.02.05 |
| [class 1]백준 검증수(2475번) (C++/Python) (0) | 2026.02.05 |