#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 | #61775545 | Utilizator | |
| Fișier | pozminmax.cpp | Dimensiune | 446 B |
| Data încărcării | 09 Decembrie 2025, 18:57 | Scor/rezultat | Eroare de compilare |
pozminmax.cpp:2:7: error: expected nested-name-specifier before 'name' using name space std; ^ pozminmax.cpp:2:7: error: 'name' has not been declared pozminmax.cpp:2:12: error: expected ';' before 'space' using name space std; ^ pozminmax.cpp:2:12: error: 'space' does not name a type pozminmax.cpp: In function 'int main()': pozminmax.cpp:6:5: error: 'cin' was not declared in this scope cin>>n; ^ pozminmax.cpp:6:5: note: suggested alternative: In file included from pozminmax.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ pozminmax.cpp:9:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=n,i++) ^ pozminmax.cpp:9:21: error: expected ';' before ')' token for(i=1,i<=n,i++) ^ pozminmax.cpp:24:1: error: expected primary-expression at end of input } ^ pozminmax.cpp:24:1: error: expected ';' at end of input pozminmax.cpp:24:1: error: expected primary-expression at end of input pozminmax.cpp:24:1: error: expected ')' at end of input pozminmax.cpp:24:1: error: expected statement at end of input pozminmax.cpp:5:21: warning: unused variable 'min' [-Wunused-variable] int n,i,v[1001],min=999999999,max=0,pozmin,pozmax; ^ pozminmax.cpp:5:35: warning: unused variable 'max' [-Wunused-variable] int n,i,v[1001],min=999999999,max=0,pozmin,pozmax; ^ pozminmax.cpp:5:41: warning: unused variable 'pozmin' [-Wunused-variable] int n,i,v[1001],min=999999999,max=0,pozmin,pozmax; ^ pozminmax.cpp:5:48: warning: unused variable 'pozmax' [-Wunused-variable] int n,i,v[1001],min=999999999,max=0,pozmin,pozmax; ^ pozminmax.cpp:24:1: error: expected '}' at end of input } ^
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ă.