Borderou de evaluare (job #743800)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Căutare binară | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 10 nov. 2023 18:23:45 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int cautbin1(int, int, int*)':
main.cpp:28:12: error: declaration of 'int n' shadows a parameter
28 | int m, n = u, p = 1, u = n, key=x;
| ^
main.cpp:26:18: note: 'int n' previously declared here
26 | int cautbin1(int n, int x, int v[])
| ~~~~^
main.cpp:28:16: error: 'u' was not declared in this scope
28 | int m, n = u, p = 1, u = n, key=x;
| ^
main.cpp:30:12: error: 'p' was not declared in this scope
30 | while (p < u){
| ^
main.cpp:32:21: error: 'key' was not declared in this scope; did you mean 'key_t'?
32 | if (v[m] <= key)
| ^~~
| key_t
main.cpp:38:10: error: 'p' was not declared in this scope
38 | m = (p + u) / 2;
| ^
main.cpp:39:16: error: 'key' was not declared in this scope; did you mean 'key_t'?
39 | if (v[m] > key)
| ^~~
| key_t
main.cpp:28:12: warning: unused variable 'n' [-Wunused-variable]
28 | int m, n = u, p = 1, u = n, key=x;
| ^