관리 메뉴

Storage Gonie

(22) [C++] 백준 No.2441 별찍기 - 4 본문

알고리즘/백준풀이1. 입출력

(22) [C++] 백준 No.2441 별찍기 - 4

Storage Gonie 2019. 4. 21. 00:34
반응형

문제

풀이

# C++

#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    
    int N = 0;
    
    cin >> N;
    
   for (int i = 0; i < N ; i++)
   {
        for (int j = 0; j < i ; j++)
            cout << " ";

        for (int j = 0; j < N-i; j++)
            cout << "*";

        cout << endl;
   }
}
반응형
Comments