← Back to List

2442번: 별 찍기 - 5 ↗

Solutions

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