import sys
n=int(sys.stdin.readline())
for i in range(1,n+1):
print(i)
sys.stdin.readline()을 사용하기 위해서 가장 먼저 sys를 import하는 것을 잊지 않도록 하자.
문제 : https://www.acmicpc.net/problem/2741
2741번: N 찍기
자연수 N이 주어졌을 때, 1부터 N까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오.
www.acmicpc.net
'Baekjoon > python' 카테고리의 다른 글
[백준 11021번] A+B - 7 (0) | 2022.04.21 |
---|---|
[백준 2742번] 기찍 N (0) | 2022.04.21 |
[백준 15552번] 빠른 A+B (0) | 2022.04.20 |
[백준 8393번] 합 (0) | 2022.04.20 |
[백준 10950번] A+B - 3 (0) | 2022.04.20 |