int main() {
int n,i,j,cc,cr;
scanf("%d",&n);
cr=(n+1)/2;
cc=(n+1)/2;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
if(cr==i || cc==j)
printf("0");
else if((n%2 == 0 && cc+1 ==
j) || (n%2 ==0 && cr+1 == i))
printf("0");
else
printf("1");
}
printf("\n");
}
}
No comments:
Post a Comment