[백준] 별 찍기2 2439

Soohyeon B·2022년 10월 17일
0

알고리즘 문제 풀이

목록 보기
12/70
#include <bits/stdc++.h>
using namespace std;


int main (void){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin >> n;
    
    for(int i =1; i<=n; i++){ // i=1
        for(int j=0; j<n-i; j++){  //j = 4
            cout << " "; //0 1 2 3
        }
        for(int j=n-i; j<n; j++){ //j = 4, 5
            cout << "*";
        }
        
        cout << "\n";
    }
    
}



profile
하루하루 성장하는 BE 개발자

0개의 댓글