帅帅山 @ 2018-08-19 21:16:23
刚看到此题,数组一顿死磕。。。。。写完后发现可以边读入边输出。。。。。做题得用脑啊(‘-’)```c while(sum!=n*n) { scanf("%d",&t); l1=sum/n; m1=sum%n; sum+=t; l2=sum/n; m2=sum%n; if(m1<m2) { for(i=l1;i<=l2;i++) for(j=m1;j<m2;j++) { if(k%2) a[i][j]=1; else a[i][j]=0; } for(i=l1;i<=l2-1;i++) for(j=m2;j<n;j++) { if(k%2) a[i][j]=1; else a[i][j]=0; } for(i=l1+1;i<=l2;i++) for(j=0;j<m1;j++) { if(k%2) a[i][j]=1; else a[i][j]=0; } } else { for(j=m1;j<n;j++) { if(k%2) a[l1][j]=1; else a[l1][j]=0; } for(i=l1+1;i<=l2-1;i++) for(j=0;j<n;j++) { if(k%2) a[i][j]=1; else a[i][j]=0; } for(j=0;j<m2;j++) { if(k%2) a[l2][j]=1; else a[l2][j]=0; } } k++;}
by yzx72424 @ 2018-08-19 21:19:07
markdown了解一下
by LCuter @ 2018-08-19 21:22:55
然而边读入边输出是OI中常有的事
by zerrun @ 2018-08-19 21:25:00
反正oi都是读文件,然后把输出直接放进某个文件(考试必用freopen不用零分了解一下),所以当然可以边读边输啊,互不影响
by Vokain @ 2018-08-19 21:25:12
然而这题边读入边输出让我觉得不舒服
by Labelray @ 2018-08-19 21:33:58
强制在线了解一下
by Juanzhang @ 2018-08-19 21:39:20
所以你要表达什么
by X_WT @ 2018-12-07 23:00:36