코딩일지/python 백준 알고리즘
python 백준 알고리즘 2438번: 별 찍기 - 1
야언
2022. 9. 4. 18:25
https://www.acmicpc.net/problem/2438
2438번: 별 찍기 - 1
첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제
www.acmicpc.net
줄 갯수를 받아서 for문을 돌리고 1~N까지 단계별로 별을 출력한다.
내 제출
stars = int(input())
for i in range(stars): ### 0부터 star-1까지
print('*'*(i+1)) ### 1부터 star까지
stars = int(input())
for i in range(1,stars+1): ### 1부터 star까지
print('*'*i) ### 1부터 star까지
이게 더 직관적이였을듯