xingjielong @ 2023-12-24 15:09:38
#include<bits/stdc++.h>
using namespace std;
int f[40000];
int main(){
int n,i=1,k=1,num=0;
cin >> n;
while(1){
if(num>n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=1;
}
k++;
num++;
cout << 0;
}
i++;
if(num>n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=0;
}
k++;
num++;
cout << 1;
}
i++;
}
return 0;
}
by xingjielong @ 2023-12-24 15:12:16
#include<bits/stdc++.h>
using namespace std;
int f[40000];
int main(){
int n,i=1,k=1,num=0;
cin >> n;
while(1){
if(num==n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=1;
}
k++;
num++;
cout << 0;
}
i++;
if(num==n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=0;
}
k++;
num++;
cout << 1;
}
i++;
}
return 0;
}
改了一下,现在20分
by DYF2765491381672943 @ 2024-01-29 10:13:41
求个关注,代码如下
#include<bits/stdc++.h>
using namespace std;
int f[40000];
int main(){
int n,i=1,k=1,num=0;
cin >> n;
while(1){
if(num==n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=1;
}
k++;
num++;
cout << 0;
}
i++;
if(num==n*n)break;
cin>>f[i];
for(int j=1;j<=f[i];j++){
if(k>n){
cout<<endl;
k=1;
}
k++;
num++;
cout << 1;
}
i++;
}
return 0;
}