#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 | #64926158 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 805 B |
| Data încărcării | 14 Iunie 2026, 22:33 | Scor/rezultat | Eroare de compilare |
pv.cpp: In function ‘int main()’: pv.cpp:5:38: error: redeclaration of ‘int s’ 5 | int a[100], n, s, i, nr=0, s1=0, s=0, s2=s; | ^ pv.cpp:5:20: note: ‘int s’ previously declared here 5 | int a[100], n, s, i, nr=0, s1=0, s=0, s2=s; | ^ pv.cpp:27:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 27 | if(a[i]%10==0; | ^ pv.cpp:27:19: warning: statement has no effect [-Wunused-value] 27 | if(a[i]%10==0; | ~~~~~~~^~~ pv.cpp:28:19: error: expected ‘)’ before ‘;’ token 28 | nr=nr+1; | ^ | ) pv.cpp:27:11: note: to match this ‘(’ 27 | if(a[i]%10==0; | ^ pv.cpp:28:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 28 | nr=nr+1; | ~~^~~~~ pv.cpp:40:22: error: found ‘:’ in nested-name-specifier, expected ‘::’ 40 | cout<<endl: | ^ | :: pv.cpp:40:18: error: ‘endl’ is not a class, namespace, or enumeration 40 | cout<<endl: | ^~~~
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ă.