#553
Să se determine indicele maximului şi cel al minimului valorilor elementelor unui vector.
| Problema | PozMinMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64769622 | Utilizator | |
| Fișier | pozminmax.cpp | Dimensiune | 449 B |
| Data încărcării | 28 Mai 2026, 22:55 | Scor/rezultat | Eroare de compilare |
pozminmax.cpp: In function ‘int main()’: pozminmax.cpp:11:9: error: ‘i’ was not declared in this scope 11 | for(i=0,i<n,i++) | ^ pozminmax.cpp:18:16: error: expected ‘;’ before '\x20' 18 | cout<< imin ' ' << endl; | ^~~~ | ; pozminmax.cpp:18:21: error: invalid operands of types ‘char’ and ‘<unresolved overloaded function type>’ to binary ‘operator<<’ 18 | cout<< imin ' ' << endl; | ~~~~^~~~~~~ pozminmax.cpp:18:28: error: expected ‘)’ before ‘;’ token 18 | cout<< imin ' ' << endl; | ^ | ) pozminmax.cpp:11:8: note: to match this ‘(’ 11 | for(i=0,i<n,i++) | ^ pozminmax.cpp:19:9: error: ‘i’ was not declared in this scope 19 | for(i=0,i<n,i++) | ^ pozminmax.cpp:26:6: error: expected primary-expression at end of input 26 | } | ^ pozminmax.cpp:26:6: error: expected ‘;’ at end of input 26 | } | ^ | ; pozminmax.cpp:26:6: error: expected primary-expression at end of input pozminmax.cpp:26:6: error: expected ‘)’ at end of input 26 | } | ^ | ) pozminmax.cpp:19:8: note: to match this ‘(’ 19 | for(i=0,i<n,i++) | ^ pozminmax.cpp:26:6: error: expected statement at end of input 26 | } | ^ pozminmax.cpp:26:6: error: expected ‘}’ at end of input pozminmax.cpp:6:1: note: to match this ‘{’ 6 | { | ^ pozminmax.cpp:7:9: warning: unused variable ‘v’ [-Wunused-variable] 7 | int v[1005],n,imin,imax,min,max; | ^ pozminmax.cpp:7:24: warning: unused variable ‘imax’ [-Wunused-variable] 7 | int v[1005],n,imin,imax,min,max; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMinMax 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ă.