Beakjoon 2444 별 찍기 - 7

Baekjoon Online Judge

문제 링크 : https://www.acmicpc.net/problem/2444

풀이 코드 : 2444 별 찍기 - 7

#include <iostream>

using namespace std;

void draw_start(int num, int N){
    for(int i=0;i<N-num-1;i++) cout<<" ";
    for(int i=0;i<1+2*num;i++) cout<<"*";
    cout<<"\n";
}

int main(){
    int N;
    cin>>N;

    for(int i=0;i<N;i++){
        draw_start(i, N);
    }
    for(int i=N-2;i>=0;i--){
        draw_start(i, N);
    }
}

채점결과

49993


© 2020. All rights reserved.

Powered by Hydejack v8.4.0