← Back to List

2523번: 별 찍기 - 13 ↗

Solutions

C++14
285 B | 285 chars
#include <iostream>
using namespace std;
int N;
int main()
{
    cin>>N;
    for(int x=1; x<=N; x++)
    {
        for(int y=0; y<x; y++) cout<<"*";
        cout<<endl;
    }
    
    for(int x=N-1; x>=1; x--)
    {
        for(int y=0; y<x; y++) cout<<"*";
        cout<<endl;
    }
}