0_0_38273073_29864.cpp: In function 'void BFS(int, int, int)': 0_0_38273073_29864.cpp:41:9: error: expected ',' or ';' before 'if' if (ii >= 0 && jj >= 0 && kk >= 0 && ii < N && jj < N && kk < N && !flag) { ^