Problem arrayfind
User P55D2K
Submission Time 2023-04-27 17:01:50
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int main()’:
arrayfind.cpp:21:42: error: expected ‘;’ before ‘if’
21 | mid = high - (high - low) / 2
| ^
| ;
22 | if (arr[mid] >= x) high = mid - 1;
| ~~
arrayfind.cpp:23:13: error: ‘else’ without a previous ‘if’
23 | else low = mid;
| ^~~~
arrayfind.cpp:29:35: error: expected ‘;’ before ‘if’
29 | mid = (high + low) / 2
| ^
| ;
30 | if (arr[mid] > x) high = mid;
| ~~
arrayfind.cpp:31:13: error: ‘else’ without a previous ‘if’
31 | else low = mid + 1;
| ^~~~