#include #include #include #include int sach[9][9]; char sachovnica [17][34]={"+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+", "|...|:::|...|:::|...|:::|...|:::|", "+---+---+---+---+---+---+---+---+", "|:::|...|:::|...|:::|...|:::|...|", "+---+---+---+---+---+---+---+---+"}; int black = 0; int white = 0; int main(void) { char line[4096]; char *s, *c, z; int i, len, x, y, w = 0; while (fgets(line, sizeof(line), stdin) != NULL) { len = strlen(line); line[len-1]=','; line[len]='\0'; w++; s = line; if (strlen(line) < 9) continue; s+=7; c = strtok(s, ","); if (strlen(c)== 2) len = 1; else len = 0; if (len) z = 'P'; else z = c[0]; y = c[1 - len] - 'a'; x = c[2 - len] - '0'; if (w==2) z = tolower(z); sachovnica[17 - x*2][4*y + 2] = z; while ((c = strtok(NULL, ",")) != NULL ) { if (strlen(c)== 2) len = 1; else len = 0; if (len) z = 'P'; else z = c[0]; y = c[1 - len] - 'a'; x = c[2 - len] - '0'; if (w==2) z = tolower(z); sachovnica[17 - x*2][4*y + 2] = z; } } for (i = 0; i < 17; i++) printf("%s\n", sachovnica[i]); return 0; }