Problem numbergame
User Potato3218
Submission Time 2023-02-24 23:00:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

numbergame.cpp: In function ‘int main()’:
numbergame.cpp:37:27: error: ‘res0’ was not declared in this scope; did you mean ‘res’?
37 | else if(abs(C[prev] - res0 < abs(C[idx] - res)) ans = cmp(ans, curr + C[prev]);
| ^~~~
| res
numbergame.cpp:38:5: error: expected primary-expression before ‘else’
38 | else ans = cmp(ans, curr + C[idx]);
| ^~~~
numbergame.cpp:37:84: error: expected ‘)’ before ‘else’
37 | else if(abs(C[prev] - res0 < abs(C[idx] - res)) ans = cmp(ans, curr + C[prev]);
| ~ ^
| )
38 | else ans = cmp(ans, curr + C[idx]);
| ~~~~