0分?怎么办
查看原帖
0分?怎么办
476919
爱国者楼主2021/5/5 16:24
#include<bits/stdc++.h>
using namespace std;
long long ch=2,ku=4,n,a;
char s[10000][10000];
int main()
{
	cin>>n;
	//freopen("s.out","w",stdout);
	s[1][1]='/';
	s[1][2]='\\';
	s[2][1]='/';
	s[2][2]='_';
	s[2][3]='_';
	s[2][4]='\\';
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<=ch;j++)
			for(int l=1;l<=ku;l++)
			{
				s[j+ch][l]=s[j][l];
				s[j+ch][l+ku]=s[j][l];
			}
		ch*=2;
		ku*=2;
	}
	for(int i=1;i<=ch;i++)
	{
		for(int j=1;j<=ku/2-i;j++) cout<<" ";
		for(int j=1;j<=ku;j++)
		{
			cout<<s[i][j];
		}
		
		cout<<endl;
	}
	return 0;
}
2021/5/5 16:24
加载中...