#54
Se citesc numere de la tastatură până la apariția lui zero. Să se determine maximul lor.
| Problema | Maxim | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64735858 | Utilizator | |
| Fișier | maxim.cpp | Dimensiune | 204 B |
| Data încărcării | 26 Mai 2026, 20:18 | Scor/rezultat | Eroare de compilare |
maxim.cpp: In function ‘int main()’: maxim.cpp:5:7: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 5 | if(!(cin>>x); | ^ maxim.cpp:6:10: error: expected ‘)’ before ‘;’ token 6 | max=x; | ^ | ) maxim.cpp:5:6: note: to match this ‘(’ 5 | if(!(cin>>x); | ^ maxim.cpp:6:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 6 | max=x; | ~~~^~ maxim.cpp:5:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 5 | if(!(cin>>x); | ^~ maxim.cpp:7:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 7 | while(x !=0){ | ^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema 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ă.