제출 #347041

#제출 시각아이디문제언어결과실행 시간메모리
347041ACmachine질문 (CEOI14_question_grader)C++17
컴파일 에러
0 ms0 KiB
int encode (int n, int x, int y) {
    int res;
    if(x > y){
        REP(j, 12){
            if((x & (1 << j))&&!(y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    else{
        REP(j, 12){
            if(!(x & (1 << j)) && (y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    return res;
}
int decode (int n, int q, int h) {
    return (q & (1 << h));
}

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:4:13: error: 'j' was not declared in this scope
    4 |         REP(j, 12){
      |             ^
encoder.cpp:4:9: error: 'REP' was not declared in this scope
    4 |         REP(j, 12){
      |         ^~~
encoder.cpp:12:13: error: 'j' was not declared in this scope
   12 |         REP(j, 12){
      |             ^
encoder.cpp:12:9: error: 'REP' was not declared in this scope
   12 |         REP(j, 12){
      |         ^~~