Problem flamethrower
User Water
Submission Time 2023-09-19 21:39:26
Score 0
Max Time N/A
Max Memory N/A

Compile Error

flamethrower.cpp: In function ‘int sum(int*, int, int)’:
flamethrower.cpp:5:7: error: ‘j’ was not declared in this scope
5 | for (j = start;j < end;j++){
| ^
flamethrower.cpp:6:14: error: ‘i’ was not declared in this scope
6 | s += array[i];
| ^
flamethrower.cpp: In function ‘int main()’:
flamethrower.cpp:19:19: error: overloaded function with no contextual type information
19 | max = sum(A, 0, k);
| ^
flamethrower.cpp:22:9: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator>’
22 | if (j > max){
| ~~^~~~~
flamethrower.cpp:23:8: error: cannot resolve overloaded function ‘max’ based on conversion to type ‘int’
23 | j = max;
| ^~~
flamethrower.cpp:26:10: error: ‘j’ was not declared in this scope
26 | cout << j;
| ^