Main.cc: In function ‘int loc(int)’: Main.cc:16:11: error: ‘x’ was not declared in this scope return ( x % 6 == 0 ? 6 : x % 6 ) ; ^ Main.cc: In function ‘int chk(int)’: Main.cc:20:19: error: ‘c’ was not declared in this scope if ( h [s] [0] > c || ( c == 2 && s == 4 ) || ( c == 3 && ( s == 2 || s == 5 || s == 7 ) ) || ( c == 1 && s == 8 ) ) ^ Main.cc:26:8: error: ‘flag’ was not declared in this scope if ( flag [i] == -1 ) ^~~~ Main.cc:26:8: note: suggested alternative: ‘log’ if ( flag [i] == -1 ) ^~~~ log Main.cc:30:21: error: ‘flg’ was not declared in this scope if ( h [s] [i] != flg [i] ) ^~~