제출 #583865

#제출 시각아이디문제언어결과실행 시간메모리
583865LIFCombo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string p = ""; int n = N; char k[4] = {'A','B','X','Y'} for(int i=0;i<n;i++) { for(int j=0;j<4;j++) { std:: string ss = p; ss = ss + k[j]; if(press == i+1) { p = p + k[j]; break; } } } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:3: error: expected ',' or ';' before 'for'
    7 |   for(int i=0;i<n;i++)
      |   ^~~
combo.cpp:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=0;i<n;i++)
      |               ^
combo.cpp:6:8: warning: unused variable 'k' [-Wunused-variable]
    6 |   char k[4] = {'A','B','X','Y'}
      |        ^