#2858
Se consideră un șir a1, a2, …, an de numere naturale.
10.3 și aflate pe poziții impare.| Problema | pv | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64750587 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 467 B |
| Data încărcării | 27 Mai 2026, 18:22 | Scor/rezultat | Eroare de compilare |
pv.cpp: In function ‘int main()’: pv.cpp:4:25: error: ‘s2’ was not declared in this scope; did you mean ‘s1’? 4 | {int n,i, V[101], s1=0; s2=0; k=0; s=0; | ^~ | s1 pv.cpp:4:31: error: ‘k’ was not declared in this scope 4 | {int n,i, V[101], s1=0; s2=0; k=0; s=0; | ^ pv.cpp:4:36: error: ‘s’ was not declared in this scope; did you mean ‘s1’? 4 | {int n,i, V[101], s1=0; s2=0; k=0; s=0; | ^ | s1 pv.cpp:17:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 17 | for(i=1;i<=n;i++) | ^~~ pv.cpp:19:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 19 | cout<<k<<endl; | ^~~~ pv.cpp:20:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 20 | for(i=1;i<=n;i+=2) | ^~~ pv.cpp:22:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 22 | cout<<s1; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pv 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ă.