#include #include int main(void) { char *biely; biely = (char *) malloc(1000); char *cierny; cierny = (char *) malloc(1000); char p[8][8]; int pos = 0, pom=1; for(int i = 0; i < 8; i ++) { for (int j = 0; j < 8; j++) { if ( pom == -1) { p[i][j] = '.'; pom=-pom; } else { p[i][j] = ':'; pom=-pom; } } pom=-pom; } gets(biely); gets(cierny); pos = 7; while (biely[pos] != '\0') { if(biely[pos] < 97) { p[biely[pos+1]-97][biely[pos+2]-49] = biely[pos]; pos += 4; } else { p[biely[pos]-97][biely[pos+1]-49] = 'P'; pos += 3; } } pos = 7; while (cierny[pos] != '\0') { if(cierny[pos] < 97) { p[cierny[pos+1]-97][cierny[pos+2]-49] = cierny[pos]+32; pos += 4; } else { p[cierny[pos]-97][cierny[pos+1]-49] = 'p'; pos += 3; } } int prem = 0; for(int i = 0; i < 8; i++) { printf("+---+---+---+---+---+---+---+---+\n"); for(int j = 0; j < 8; j ++) { if(pom == 1) { printf("|.%c.", p[j][7-i]); pom = -pom; } else { pom = -pom; printf("|:%c:", p[j][7-i]); } } pom = -pom; printf("|\n"); } printf("+---+---+---+---+---+---+---+---+\n"); return 0; }