S001-AC.cc 423 Bytes
#include <iostream>
#include <cmath>
#include <string>

using namespace std;

void bars(string* array, int pos, int n)
{
	array[pos].append(n,'*');
	if(n == 1)
	{
		return;
	}
	bars(array,pos+1,--n);
	bars(array,pos+pow(2,n),n);
}
		
int main()
{
	int n;
	cin >> n;
	string* array = new string[(int)(pow(2,n) - 1)];
	bars(array,0,n);
	for(int i = (pow(2,n) - 2); i > -1; i--)
	{
		cout << array[i] << endl;
	}
	return 0;
}