albertma @ 2024-10-03 16:40:13
#include<iostream>
using namespace std;
int main(){
int p,f=0,t[10010];
int i=1;
while(i){
cin>>t[i];
if(i==1)
continue;
for(int j=1;j<=t[i];j++){
cout<<f;
}
p+=t[i];
if(p%t[1]==0)
cout<<endl;
f=!f;
if(p==t[1]*t[1])
break;
}
return 0;
}
by 2024YCNOI @ 2024-10-05 21:16:00
#include <iostream>
using namespace std;
int main(){
int a,n,t=0,i=0,b,s=0;
cin>>n;
while(s<n*n){
cin>>a;
i++;
for(b=a;b>=1;b--){
if(t==n){cout<<endl;t=0;}
if(i%2==1)cout<<0;
else cout<<1;
t++;
s++;
}
}
cout<<endl;
return 0;
}
把代码贴上去就行了