#1880
Se consideră un şir format din n numere întregi. Șirul conține cel puțin un număr pozitiv. Să se determine lungimea maximă a unei secvenţe din şir care are proprietatea că este formată doar din valori strict pozitive.
| Problema | platou3 | Operații I/O |
platou3.in/platou3.out
|
|---|---|---|---|
| Limita timp | 0.01 secunde | Limita memorie |
Total: 0.3 MB
/
Stivă 0.3 MB
|
| Id soluție | #64824098 | Utilizator | |
| Fișier | platou3.cpp | Dimensiune | 365 B |
| Data încărcării | 03 Iunie 2026, 20:32 | Scor/rezultat | Eroare de compilare |
platou3.cpp: In function ‘int main()’: platou3.cpp:7:25: error: expected ‘;’ before ‘int’ 7 | fout.open("platou3.out") | ^ | ; 8 | int n,ct=0,ctmax=1,x; | ~~~ platou3.cpp:9:9: error: ‘n’ was not declared in this scope 9 | fin>>n; | ^ platou3.cpp:11:11: error: ‘x’ was not declared in this scope 11 | {fin>>x; | ^ platou3.cpp:13:6: error: ‘ct’ was not declared in this scope 13 | ct++; | ^~ platou3.cpp:14:11: error: ‘ct’ was not declared in this scope 14 | else ct=0; | ^~ platou3.cpp:15:9: error: ‘ct’ was not declared in this scope 15 | if(ct>ctmax) | ^~ platou3.cpp:15:12: error: ‘ctmax’ was not declared in this scope 15 | if(ct>ctmax) | ^~~~~ platou3.cpp:18:11: error: ‘ctmax’ was not declared in this scope 18 | fout<<ctmax; | ^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema platou3 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ă.