제출 #1036734

#제출 시각아이디문제언어결과실행 시간메모리
1036734erering로봇 대회 (IOI23_robot)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
void set_instruction(int S[5], int Z, char A){

}
void program_pulibot(){
    int s[5]={0,1,0,0,-2};
    set_instruction(s,1,'E');
    s={0,-2,0,0,-2};
    set_instruction(s,1,'E');
    s={0,0,0,-2,1};
    set_instruction(s,1,'S');
    s={0,0,0,-2,-2};
    set_instruction(s,1,'S');
}

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

robot.cpp: In function 'void program_pulibot()':
robot.cpp:9:6: error: assigning to an array from an initializer list
    9 |     s={0,-2,0,0,-2};
      |     ~^~~~~~~~~~~~~~
robot.cpp:11:6: error: assigning to an array from an initializer list
   11 |     s={0,0,0,-2,1};
      |     ~^~~~~~~~~~~~~
robot.cpp:13:6: error: assigning to an array from an initializer list
   13 |     s={0,0,0,-2,-2};
      |     ~^~~~~~~~~~~~~~