它自己都说了跟2996相反,题目很奇怪,仔细看就是2996的reverse……汗 跟之前去北大校赛的时候那道模拟就很像,当时就是直接把格子贴上了,所以我还是贴了…… #include<cstdio> #include<cstring> using namespace std; char chess[55][55]={ "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+" }; int main() { int i,len,row,col; char str[50],x; while (gets(str)!=NULL){ i=7; len=strlen(str); while (i<len){ if (str[i]>='A'&&str[i]<='Z') x=str[i++]; else x='P'; col=str[i++]-'a'; row=8-(str[i++]-'0'); row=row*2+1,col=col*4+2; chess[row][col]=x; i++; } gets(str); i=7; len=strlen(str); while (i<len){ if (str[i]>='A'&&str[i]<='Z') x='a'-'A'+str[i++]; else x='p'; col=str[i++]-'a'; row=8-(str[i++]-'0'); row=row*2+1,col=col*4+2; chess[row][col]=x; i++; } for (i=0;i<17;i++) printf("%s/n",chess[i]); } }