//poj 1941
//sep9
#include <iostream>
using namespace std;
const int maxW=2048;
const int maxH=1024;
int pow2[32];
char g[maxH+10][maxW+10];
void print(int x,int y,int n)
{
	if(n==1){
		g[x][y+1]='/';
		g[x][y+2]='\\';
		g[x+1][y]='/';
		g[x+1][y+1]='_';
		g[x+1][y+2]='_';
		g[x+1][y+3]='\\';
		return ;
	}
	print(x,y+pow2[n-1],n-1);
	print(x+pow2[n-1],y,n-1);
	print(x+pow2[n-1],y+pow2[n],n-1);
	return ;	
}

int main()
{
	pow2[0]=1;
	for(int i=1;i<30;++i)
		pow2[i]=pow2[i-1]*2;
	int n;
	while(scanf("%d",&n)==1&&n){
		int H=pow2[n];
		int W=pow2[n+1];
		memset(g,' ',sizeof(g));
		print(0,0,n);
		for(int i=0;i<H;++i){
			for(int j=0;j<W;++j)
				printf("%c",g[i][j]);
			printf("\n");
		}
		puts("");
	}		
	return 0;	
}


相关文章:

  • 2021-08-14
  • 2022-01-18
  • 2021-10-03
  • 2021-12-05
  • 2022-12-23
  • 2021-09-08
  • 2021-07-16
  • 2022-12-23
猜你喜欢
  • 2021-07-11
  • 2021-06-09
  • 2021-07-16
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案