답안 #315417

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
315417 2020-10-22T21:22:34 Z Ahmad_Hasan Poklon (COCI17_poklon7) C++17
컴파일 오류
0 ms 0 KB
        i--;
    }



    i=0;
    for(;i<trg.size()-1&&trg[i]=='0';i++);
    for(;i<trg.size();i++)cout << trg[i];

    return 0;
}

/***
3 5 4
1 2 4 2 1
3 5 1 2 4
1 5 7 1 2

*/

Compilation message

poklon.cpp:2:9: error: 'i' does not name a type
    2 |         i--;
      |         ^
poklon.cpp:3:5: error: expected declaration before '}' token
    3 |     }
      |     ^
poklon.cpp:7:5: error: 'i' does not name a type
    7 |     i=0;
      |     ^
poklon.cpp:8:5: error: expected unqualified-id before 'for'
    8 |     for(;i<trg.size()-1&&trg[i]=='0';i++);
      |     ^~~
poklon.cpp:8:10: error: 'i' does not name a type
    8 |     for(;i<trg.size()-1&&trg[i]=='0';i++);
      |          ^
poklon.cpp:8:38: error: 'i' does not name a type
    8 |     for(;i<trg.size()-1&&trg[i]=='0';i++);
      |                                      ^
poklon.cpp:9:5: error: expected unqualified-id before 'for'
    9 |     for(;i<trg.size();i++)cout << trg[i];
      |     ^~~
poklon.cpp:9:10: error: 'i' does not name a type
    9 |     for(;i<trg.size();i++)cout << trg[i];
      |          ^
poklon.cpp:9:23: error: 'i' does not name a type
    9 |     for(;i<trg.size();i++)cout << trg[i];
      |                       ^
poklon.cpp:11:5: error: expected unqualified-id before 'return'
   11 |     return 0;
      |     ^~~~~~
poklon.cpp:12:1: error: expected declaration before '}' token
   12 | }
      | ^