728x90
반응형
SMALL
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int n;
cin >> n;
for(int i=1;i<n+1;i++){
cout << string(i,'*') << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(void) {
int n;
cin >> n;
for(int i=0;i<n;i++){
for(int j=0;j<i+1;j++)
cout << "*";
cout << endl;
}
return 0;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
[프로그래머스] 가위 바위 보 (0) | 2025.09.05 |
---|---|
[프로그래머스] 개미 군단 (0) | 2025.09.05 |
[프로그래머스] 옷가게 할인 받기 (0) | 2025.09.04 |
[프로그래머스] 모음 제거 (0) | 2025.09.04 |
[프로그래머스] 중복된 숫자 개수 (0) | 2025.09.04 |
댓글