ZZYzzy321 @ 2024-08-30 22:51:48
#include<bits/stdc++.h>
using namespace std;
int a,b[205],j;
bool for1(){
int k=0;
for(j=0;j<205;j++){
k+=b[j];
if(k>=a*a) return 1;
}
return 0;
}
int main(){
cin>>a;
int c[a*a];
int i=0;
while (1){
cin>>b[i];
i++;
if(for1()) break;
}
int k,l=0;
for(int i=0;i<j;i++){
for(k=0;k<b[i];k++){
c[k+l]=i%2;
}
l+=k;
}
int o=0;
for(int i=0;i<a;i++){
for(int p=0;p<a;p++){
cout<<c[o];
o++;
}
cout<<endl;
}
}
by Hebe_Gu @ 2024-08-30 23:44:39
j算出来之后要+1哦!前面的
by ZZYzzy321 @ 2024-09-01 15:30:16
@Hebe_Gu 感谢大佬,已关注