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

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

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

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

 

2441๋ฒˆ: ๋ณ„ ์ฐ๊ธฐ - 4

์ฒซ์งธ ์ค„์—๋Š” ๋ณ„ N๊ฐœ, ๋‘˜์งธ ์ค„์—๋Š” ๋ณ„ N-1๊ฐœ, ..., N๋ฒˆ์งธ ์ค„์—๋Š” ๋ณ„ 1๊ฐœ๋ฅผ ์ฐ๋Š” ๋ฌธ์ œ ํ•˜์ง€๋งŒ, ์˜ค๋ฅธ์ชฝ์„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌํ•œ ๋ณ„(์˜ˆ์ œ ์ฐธ๊ณ )์„ ์ถœ๋ ฅํ•˜์‹œ์˜ค.

www.acmicpc.net

 

#include <iostream>

using namespace std;

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