求助
查看原帖
求助
962476
My3211215504楼主2024/3/27 21:45
#include<bits/stdc++.h>
using namespace std;
int a[1100][1100]={1};
int fzdg(int x,int y,int z)
{

	if(z==1) return 0;
	for(int i=x;i<x+z/2;i++)
	{
		for(int j=y;j<y+z/2;j++)
		{
			a[i][j]=0;
		}
	}
	fzdg(x,y+z/2,z/2);
	fzdg(x+z/2,y,z/2);
	fzdg(x+z/2,y+z/2,z/2);
}
int main()
{
	int n,fz;
	cin >> n;
	fz=pow(2,n);
	fzdg(1,1,fz);
	for(int i=1;i<=fz;i++)
	{
		for(int j=1;j<=fz;j++)
		{
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}

这个哪里错了有没有大佬解释一下

2024/3/27 21:45
加载中...