#include #include int main() { int nb,nw,max,pos_w,pos_b,c,x,y,i,fckb,fckw; int pol[8][8] = {{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0}}; char temp[256]; char white[512]; char black[512]; scanf("%8s%s\n",temp,black); scanf("%8s%s\n",temp,white); nb = strlen(black); nw = strlen(white); max = nb>nw?nb:nw; i = 0; pos_w = 0; pos_b = 0; fckb = 1; fckw = 1; while (i='A' && black[pos_b]<='Z') { c = black[pos_b]; pos_b++; } else{ c = 'P'; } pol[black[pos_b]-'a'][black[pos_b+1]-'1']=c; pos_b += 3; } if (pos_w < nw ) { if (white[pos_w]>='A' && white[pos_w]<='Z'){ c = white[pos_w]; pos_w++; } else c = 'P'; pol[white[pos_w]-'a'][white[pos_w+1]-'1']=c-'A'+'a'; pos_w+=3; } i++; } i = 1; for (x=7;x>=0;x--) { i=(i+1)%2; printf("+---+---+---+---+---+---+---+---+\n"); for (y=0;y<8;y++) { i=(i+1)%2; c=i?'.':':'; printf("|%c%c%c",c,!pol[y][x]?c:pol[y][x],c); } printf("|\n"); } printf("+---+---+---+---+---+---+---+---+"); return 0; }