叠筐
5 @ W
ABBBBBBBBBA
ABAAAAAAABA
ABABBBBBABA
ABABAAABABA
ABABABABABA
ABABAAABABA
ABABBBBBABA
ABAAAAAAABA
ABBBBBBBBBA
AAAAAAAAA
@@@
@WWW@
@W@W@
@WWW@
@@@
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i,j,d=0,k;
char a,b,c[88][88];
while(scanf("%d %c %c",&n,&a,&b)!=EOF)
{
if(d==1)
printf("\n");
if(n==1)
{printf("%c\n",a);
d=1;
continue;}
if((n+1)%4==0)
{
for(j=0; j<n; j++)
{
for(i=j; i<n-j; i++)
{
if(j%2==0)
{
c[i][j]=b;
c[j][i]=b;
c[n-1-j][i]=b;
c[i][n-1-j]=b;
}
else
{
c[i][j]=a;
c[j][i]=a;
c[n-1-j][i]=a;
c[i][n-1-j]=a;
}
}
}
}
if((n+1)%4!=0)
{
for(j=0; j<n; j++)
{
for(i=j; i<n-j; i++)
{
if(j%2==0)
{
c[i][j]=a;
c[j][i]=a;
c[n-1-j][i]=a;
c[i][n-1-j]=a;
}
else
{
c[i][j]=b;
c[j][i]=b;
c[n-1-j][i]=b;
c[i][n-1-j]=b;
}
}
}
}
c[0][0]=' ';
c[n-1][n-1]=' ';
c[0][n-1]=' ';
c[n-1][0]=' ';
for(i=0; i<n; i++)
{
for(k=0; k<n; k++)
printf("%c",c[i][k]);
printf("\n");
}
d=1;
}
return 0;
}