qi___ye @ 2022-10-14 23:58:07
#include<stdio.h>
int main(){
int N,i,m,sum1=0,sum2=0,b=0;
scanf("%d",&N);
int a[100000];
for(i=0;i>=0;i++){
scanf("%d",&a[i]);
sum2=sum2+a[i];
b++;
if(sum2==N*N){
break;
}
}
for(i=0;i<b;i++){
for(m=0;m<=a[i];m++){
if(a[i]==m){
break;
}
sum1++;
if(sum1%N==1){
printf("\n");
}
if(i%2==1){
printf("1");
}
if(i%2==0){
printf("0");
}
}
}
return 0;
}
by ud2_ @ 2022-10-15 00:06:33
输入样例,应该输出
0001000
0001000
0001111
0001000
0001000
0001000
1111111
但这个程序输出
0001000
0001000
0001111
0001000
0001000
0001000
1111111
by Ayano_Kimishima @ 2022-10-15 08:17:36
@qi___ye 多了换行
by qi___ye @ 2022-10-15 11:20:55
@chenhaofeng 好的,谢谢啦