救
查看原帖
救
794893
LYJ_B_O_Creation楼主2023/5/9 20:19

没思路,然后看了篇题解,灵感爆发,但错了,跟着题解改后,还错了

#include<bits/stdc++.h> 
#define int long long
using namespace std;
int a[1235][1235];
signed main()
{
	int n;
	cin >> n;
	a[0][n + 1] = 1;
	int ans = (1 << n);
	for(int i = 1;i <= ans;i++)
	{
		for(int j = 1;j <= ans;j++)
		{
			a[i][j] = a[i - 1][j] ^ a[i - 1][j + 1];
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}
2023/5/9 20:19
加载中...