#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 | #64246536 | Utilizator | |
| Fișier | pozminmax.cpp | Dimensiune | 795 B |
| Data încărcării | 25 Aprilie 2026, 13:49 | Scor/rezultat | Eroare de compilare |
pozminmax.cpp:10:31: error: expected initializer before ‘-’ token 10 | int n,v[1001],pozmn,pozmx,minn-1e5,maxx-1e9; | ^ pozminmax.cpp: In function ‘int main()’: pozminmax.cpp:13:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 13 | cin>>n>>minn>>maxx; | ^~~ | std::cin In file included from pozminmax.cpp:9: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ pozminmax.cpp:13:13: error: ‘minn’ was not declared in this scope 13 | cin>>n>>minn>>maxx; | ^~~~ pozminmax.cpp:13:19: error: ‘maxx’ was not declared in this scope 13 | cin>>n>>minn>>maxx; | ^~~~ pozminmax.cpp:14:9: error: ‘i’ was not declared in this scope 14 | for(i=1;i<=n;i++) | ^ pozminmax.cpp:16:9: error: ‘i’ was not declared in this scope 16 | for(i=1;i<=n;i++){ | ^ pozminmax.cpp:22:9: error: ‘pozminn’ was not declared in this scope; did you mean ‘pozmn’? 22 | pozminn=v[i]; | ^~~~~~~ | pozmn pozminmax.cpp:24:9: error: ‘pozmaxx’ was not declared in this scope; did you mean ‘pozmx’? 24 | pozmaxx=v[i]; | ^~~~~~~ | pozmx pozminmax.cpp:27:5: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 27 | cout<<pozminn<< " " <<pozmaxx; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ pozminmax.cpp:27:11: error: ‘pozminn’ was not declared in this scope; did you mean ‘pozmn’? 27 | cout<<pozminn<< " " <<pozmaxx; | ^~~~~~~ | pozmn pozminmax.cpp:27:27: error: ‘pozmaxx’ was not declared in this scope; did you mean ‘pozmx’? 27 | cout<<pozminn<< " " <<pozmaxx; | ^~~~~~~ | pozmx
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ă.