문제설명

 

소스코드

코드1

#include<iostream>
using namespace std;
int main()
{
	int input;
	cin >> input;
	for (int i = 1; i <= input; ++i)
	{
		for (int j = 1; j <= input; ++j)
		{
			if (input - j < i) cout << "*";
			else cout << " ";
		}
		cout << endl;
	}
}

 

코드2

#include<iostream>
using namespace std;
int main()
{
	int input;
	cin >> input;
	for (int i = 1; i <= input; ++i)
	{
		for (int j = 1; j <= input -i; ++j) cout << " ";
		for (int j = 1; j <= i; ++j) cout << "*";
		cout << endl;
	}
}