#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 | #64750385 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 393 B |
| Data încărcării | 27 Mai 2026, 18:10 | Scor/rezultat | Eroare de compilare |
pv.cpp: In function ‘int main()’: pv.cpp:12:6: error: ‘s’ was not declared in this scope 12 | s=s+v[i]; | ^ pv.cpp:10:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=n;i++) | ^~~ pv.cpp:13:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | cout<<s<<'\n'; | ^~~~ pv.cpp:13:12: error: ‘s’ was not declared in this scope 13 | cout<<s<<'\n'; | ^ pv.cpp:16:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 16 | if(v[i]%10==0) | ^~ pv.cpp:18:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 18 | if(v[i]%3==0) | ^~ pv.cpp:4:17: warning: unused variable ‘s1’ [-Wunused-variable] 4 | {int v[101],n,i,s1=0,s2=0,s3=0,k=0; | ^~
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ă.