Submission #253332

#TimeUsernameProblemLanguageResultExecution timeMemory
253332imeimi2000Cluedo (IOI10_cluedo)C++17
Compilation error
0 ms0 KiB
int Theory(int, int, int); void Solve() { int a[] = { 0, 6, 10, 6 }; while (int x = Theory(a[1], a[2], a[3]); x) --a[x]; }

Compilation message (stderr)

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:5:42: error: expected ')' before ';' token
   while (int x = Theory(a[1], a[2], a[3]); x) --a[x];
                                          ^
cluedo.cpp:5:3: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   while (int x = Theory(a[1], a[2], a[3]); x) --a[x];
   ^~~~~
cluedo.cpp:5:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   while (int x = Theory(a[1], a[2], a[3]); x) --a[x];
                                            ^
cluedo.cpp:5:14: warning: unused variable 'x' [-Wunused-variable]
   while (int x = Theory(a[1], a[2], a[3]); x) --a[x];
              ^
cluedo.cpp:5:44: error: 'x' was not declared in this scope
   while (int x = Theory(a[1], a[2], a[3]); x) --a[x];
                                            ^