제출 #372566

#제출 시각아이디문제언어결과실행 시간메모리
372566Christopher_RdzMemory (IOI10_memory)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" char cubeta[52]; void play() { char a, b; int pos = 1; for (int i = 1; i <= 50; i++){ a = faceup(i); char[i] = a; } for (int i = 1; i <= 50; i++){ for (int j = 1; j <= 50; j++){ if (i != j){ if (cubeta[i] == cubeta[j]){ faceup(i); faceup(j); } } } } }

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

memory.cpp: In function 'void play()':
memory.cpp:11:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   11 |      char[i] = a;
      |          ^
memory.cpp:11:10: error: structured binding declaration cannot have type 'char'
   11 |      char[i] = a;
      |          ^~~
memory.cpp:11:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
memory.cpp:11:12: error: redeclaration of 'auto i'
   11 |      char[i] = a;
      |            ^
memory.cpp:9:13: note: 'int i' previously declared here
    9 |    for (int i = 1; i <= 50; i++){
      |             ^
memory.cpp:11:10: error: cannot decompose non-array non-class type 'char'
   11 |      char[i] = a;
      |          ^~~
memory.cpp:11:10: warning: unused structured binding declaration [-Wunused-variable]
memory.cpp:7:12: warning: unused variable 'b' [-Wunused-variable]
    7 |    char a, b;
      |            ^
memory.cpp:8:7: warning: unused variable 'pos' [-Wunused-variable]
    8 |   int pos = 1;
      |       ^~~