思路
对于一个n
for(1-n)
for(1-n)
a[i][j]等于n的(i+j-2)次方
即a[i][j]=pow(2,i+j-2);
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll N=1e5+1e4,M=1e3+1e2;
const ll Maxn=0x3ffffff,Minm=-0x3ffffff;
ll n;
ll a[M][M];
signed main()
{
cin>>n;
while(n!=0)
{
for(ull i=1;i<=n;i++)
{
for(ull j=1;j<=n;j++)
{
a[i][j]=pow(2,i+j-2);
cout<<a[i][j]<<" ";
}
cout<<"\n";
}
cout<<"\n";
cin>>n;
}
}
6
panda panda