#354
Se dau n numere întregi. Calculaţi cel mai mare dintre cele n numere date.
| Problema | n_maxim | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64094843 | Utilizator | |
| Fișier | n_maxim.cpp | Dimensiune | 186 B |
| Data încărcării | 16 Aprilie 2026, 17:20 | Scor/rezultat | Eroare de compilare |
n_maxim.cpp:2:20: error: expected ‘;’ before ‘int’ 2 | using namespace std | ^ | ; 3 | int main() | ~~~ n_maxim.cpp: In function ‘int main()’: n_maxim.cpp:7:16: warning: left operand of comma operator has no effect [-Wunused-value] 7 | for(int i=1 ; i<=n,i++) | ~^~~ n_maxim.cpp:7:23: error: expected ‘;’ before ‘)’ token 7 | for(int i=1 ; i<=n,i++) | ^ | ; n_maxim.cpp:9:9: error: ‘x0’ was not declared in this scope; did you mean ‘x’? 9 | if(vmax<x0 | ^~ | x n_maxim.cpp:9:11: error: expected ‘)’ before ‘vmax’ 9 | if(vmax<x0 | ~ ^ | ) 10 | vmax=xi | ~~~~ n_maxim.cpp:14:5: error: expected statement at end of input 14 | } | ^ n_maxim.cpp:14:5: error: expected ‘}’ at end of input n_maxim.cpp:8:1: note: to match this ‘{’ 8 | {cin>>x; | ^ n_maxim.cpp:14:5: error: expected ‘}’ at end of input 14 | } | ^ n_maxim.cpp:4:1: note: to match this ‘{’ 4 | { int n,x,vmax ; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema n_maxim 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ă.