为什么我的ac代码无法在本地的devc运行
查看原帖
为什么我的ac代码无法在本地的devc运行
1451139
anyinjvshi楼主2025/1/31 16:08

求助,我的代码是在其他在线编程网站写的,代码如下

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;int m=1;int ci[11]; 
	cin>>n;
	for(int i=1;i<=n;i++){                           //确定行列数2的n次方 
		m*=2;
		ci[i]=m;
	}
	int a[1025][1025];
	a[1024][1]=1;a[1023][1]=0;a[1024][2]=1;a[1023][2]=1;//0111方阵 //0000方阵 
	for(int h=1;h<=n-1;h++){
	for(int i=1;i<=ci[h];i++){
		for(int x=1024;x>=1025-ci[h];x--){
				for(int y=1;y<=ci[h];y++){
					a[x][y+ci[h]]=a[x][y];
					a[x-ci[h]][y+ci[h]]=a[x][y];
					a[x-ci[h]][y]=0; 
				}
			}	
		}	
	}
    for(int y=1;y<=m;y++){
	   for(int x=1025-m;x<=1024;x++){                   //输出 
            cout<<a[x][y]<<' ';
            if(x==1024){
                cout<<endl;
            }
        }
    }

} 
2025/1/31 16:08
加载中...