#180
Să se ordoneze crescător elementele dintr-un şir dat cuprinse între elementul de valoare maximă şi cel de valoare minimă.
| Problema | sortMinMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64495453 | Utilizator | |
| Fișier | sortminmax.cpp | Dimensiune | 726 B |
| Data încărcării | 11 Mai 2026, 10:38 | Scor/rezultat | Eroare de compilare |
sortminmax.cpp: In function ‘int main()’: sortminmax.cpp:15:11: error: ‘i’ was not declared in this scope 15 | min=v[i]; | ^ sortminmax.cpp:16:5: error: ‘p’ was not declared in this scope 16 | p min=1; | ^ sortminmax.cpp:17:12: error: overloaded function with no contextual type information 17 | max=v[1]; | ^ sortminmax.cpp:18:6: error: expected ‘;’ before ‘max’ 18 | p max=1; | ^~~~ | ; sortminmax.cpp:20:16: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator>’ 20 | if(v[i]>max){ | ~~~~^~~~ sortminmax.cpp:21:20: error: overloaded function with no contextual type information 21 | max=v[i]; | ^ sortminmax.cpp:22:14: error: expected ‘;’ before ‘max’ 22 | p max=i; | ^~~~ | ; sortminmax.cpp:24:16: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<’ 24 | if(v[i]<min){ | ~~~~^~~~ sortminmax.cpp:25:20: error: overloaded function with no contextual type information 25 | min=v[i]; | ^ sortminmax.cpp:26:14: error: expected ‘;’ before ‘min’ 26 | p min=i; | ^~~~ | ; sortminmax.cpp:29:20: error: expected ‘;’ before ‘max’ 29 | for(i=p min;i<p max;i++){ | ^~~~ | ; sortminmax.cpp:29:21: error: overloaded function with no contextual type information 29 | for(i=p min;i<p max;i++){ | ^~~ sortminmax.cpp:29:24: error: expected ‘)’ before ‘;’ token 29 | for(i=p min;i<p max;i++){ | ~ ^ | ) sortminmax.cpp:29:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 29 | for(i=p min;i<p max;i++){ | ^~~ sortminmax.cpp:29:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 29 | for(i=p min;i<p max;i++){ | ^ sortminmax.cpp:13:9: warning: unused variable ‘pmax’ [-Wunused-variable] 13 | int pmax; | ^~~~ sortminmax.cpp:14:9: warning: unused variable ‘pmin’ [-Wunused-variable] 14 | int pmin; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sortMinMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.