본문 바로가기

Programming/BaekJoon

[C++] 백준 2442번 : 별 찍기 - 5


https://www.acmicpc.net/problem/2442




#include <iostream>

using namespace std;

int main() {

int n;

cin >> n;

for (int i = 1; i <= n; i++) {

for (int j = n - i; j > 0; j--)

cout << " ";

for (int k = 1; k <= 2 * i - 1; k++)

cout a<< "*";

cout << "\n";

}

}