#include "iostream" #include "cstdio" #include "cmath" #include "algorithm" #include "string" #include "vector" using namespace std; int main() { int n, m; cin >> n >> m; char** x = new char*[n]; for (int i = 0; i < n; ++i) { x[i] = new char[m]; } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> x[i][j]; } }char b = 'B', w = 'W',temp; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (x[i][j] == '.') { if ((j + i) % 2 == 0) { x[i][j] = 'B'; } else x[i][j] = 'W'; } } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout<< x[i][j]; } cout << endl; } system("pause"); return 0; }
58 97 --.........-..-...............-....--..-.-.-..-.-.---.-.-...-.--..-.---.-....-...-.---..-.-.-...- .---........--.........--------...--..--...--.-....--.-.--..--..-.....-...-.--.--.......--....-.- .-...-.--.-..--..-..---..-.-....-...-..-....--...-.....-...-.-...-.--.-.-.---..--......-..-...-.- --.......--......-........-....-...--..-.-.-....-.--...--...-.-.--..-..--...--.-..-....-.....--.. .-----..-...--..-..-...-.-...-.-.-.---.-...--.-..--...-..-........---.........-.--......-.-..--.- --......-...
--BWBWBWBWB-BW-WBWBWBWBWBWBWBW-WBWB--WB-B-B-BW-W-W---W-W-WBW-W--BW-W---W-WBWB-BWB-B---BW-W-W-WBW-
W---WBWBWBWB--WBWBWBWBW--------BWB--WB--WBW--B-BWBW--B-B--WB--WB-BWBWB-BWB-B--W--BWBWBWB--WBWB-B-
B-BWB-B--W-WB--WB-BW---WB-B-BWBW-WBW-WB-BWBW--BWB-BWBWB-BWB-B-BWB-B--W-W-W---WB--WBWBWB-BW-WBW-W-
--WBWBWBW--BWBWBW-WBWBWBWB-BWBW-WBW--BW-W-W-WBWB-B--WBW--BWB-B-B--WB-BW--BWB--W-WB-BWBW-WBWBW--BW
B-----BW-WBW--BW-WB-BWB-B-BWB-B-B-B---B-BWB--W-WB--WBW-WB-BWBWBWBW---WBWBWBWBW-W--BWBWBW-W-WB--W-
--WBWBWB-BWB
sh: 1: pause: not found