## 叠筐

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 12377    Accepted Submission(s): 3196

Problem Description

Input

Output

Sample Input

11 B A 5 @ W

Sample Output

`AAAAAAAAA ABBBBBBBBBAABAAAAAAABAABABBBBBABAABABAAABABAABABABABABAABABAAABABAABABBBBBABAABAAAAAAABAABBBBBBBBBA AAAAAAAAA  @@@ @WWW@@W@W@@WWW@ @@@`

/*题解：

1.四角均有空格，要输出空格字符' '。

2.除第一次输入外，以后每一次输入后均为先换行后输出。

3.箩筐最中心的字符为第一个字符。

*/

`#include<cstdio>#include<cstring>int main(){    int n,i,j,t1,t2,ok=0;    char a,b,map[88][88];    while(scanf("%d %c %c",&n,&a,&b)!=EOF)    {        if(ok)        {            printf("\n");        }        ok=1;        memset(map,0,sizeof(map));        if(n==1)    {printf("%c\n",a);continue;}        t1=t2=(n+1)/2;        while(1)        {            for(i=t1; i<=t2; i++)            {                for(j=t1; j<=t2; j++)                {                    if(map[i][j]==0)                        map[i][j]=a;                }            }            t1--;            t2++;            if(t1==0) break;            for(i=t1; i<=t2; i++)            {                for(j=t1; j<=t2; j++)                {                    if(map[i][j]==0)                        map[i][j]=b;                }            }            t1--;            t2++;            if(t1==0) break;        }        map[1][1]=map[n][1]=' ';        map[1][n]=map[n][n]=' ';        for(i=1; i<=n; i++)        {            for(j=1; j<=n; j++)            {                printf("%c",map[i][j]);            }            printf("\n");        }    }    return 0;}`