728x90

😢 단순 출력 문제
😊 1개부터 입력 받는 숫자만큼 1개씩 증가하는 별 출력
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
ios::sync_with_stdio(false), cin.tie(nullptr); | |
int n; | |
cin >> n; | |
for (int row = 0; row < n; row++) { | |
for (int col = 0; col <= row; col++) { | |
cout << '*'; | |
} | |
cout << '\n'; | |
} | |
} |
'Algorithm > C&C++' 카테고리의 다른 글
백준 2752번: 세수정렬 c++(cpp) (0) | 2021.09.06 |
---|---|
백준 10871번: X보다 작은 수 c++(cpp) (0) | 2021.09.06 |
백준 10804번: 카드 역배치 c++(cpp) (0) | 2021.09.02 |
백준 2440번: 별 찍기 - 3 c++(cpp) (0) | 2021.09.01 |
백준 2439번: 별 찍기 - 2 c++(cpp) (0) | 2021.08.31 |