4kilometers @ 2016-12-17 09:00:44
本人过蠢,求教
#include<cstdio>
#include<cmath>
using namespace std;
int n,i=1,t=0,m;
int main()
{
scanf("%d",&n);
while (i<=pow(n,2))
{
scanf("%d",&m);
if (i%2==1)
{
for (int j=1;j<=m;++j)
{
++t;
if (t==n)
{
printf("\n");
t=0;
}
printf("0 ");
}
}
else
{
for (int k=1;k<=m;++k)
{
++t;
if (t==n)
{
printf("\n");
t=0;
}
printf("1 ");
}
}
++i;
}
return 0;
}
by 4kilometers @ 2016-12-21 12:41:17
大神们快来祝我啊
by 已注销uHwBPs&#d @ 2018-10-05 23:10:23
不会。。。