๐Ÿ• Baaaaaarking/0x02๊ฐ• - ๊ธฐ์ดˆ ์ฝ”๋“œ ์ž‘์„ฑ ์š”๋ น II

[BOJ][C++] ๋ฐฑ์ค€ 2443๋ฒˆ: ๋ณ„ ์ฐ๊ธฐ - 6

์„ ๋‹ฌ 2023. 5. 26. 23:30
๋ฐ˜์‘ํ˜•

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

 

2443๋ฒˆ: ๋ณ„ ์ฐ๊ธฐ - 6

์ฒซ์งธ ์ค„์—๋Š” ๋ณ„ 2×N-1๊ฐœ, ๋‘˜์งธ ์ค„์—๋Š” ๋ณ„ 2×N-3๊ฐœ, ..., N๋ฒˆ์งธ ์ค„์—๋Š” ๋ณ„ 1๊ฐœ๋ฅผ ์ฐ๋Š” ๋ฌธ์ œ ๋ณ„์€ ๊ฐ€์šด๋ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋Œ€์นญ์ด์–ด์•ผ ํ•œ๋‹ค.

www.acmicpc.net

 

#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    for(int i=n; i>0; i--) {
        for(int j=0; j<n-i; j++)
            cout << " ";
        for(int j=0; j<2*i-1; j++)
            cout << "*";
        cout << "\n";
    }
    return 0;
}
๋ฐ˜์‘ํ˜•