#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 | #64816840 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 672 B |
| Data încărcării | 03 Iunie 2026, 11:43 | Scor/rezultat | Eroare de compilare |
pv.cpp: In function ‘int main()’: pv.cpp:7:17: error: invalid types ‘int[int]’ for array subscript 7 | cin >> v[i]; | ^ pv.cpp:9:18: error: invalid types ‘int[int]’ for array subscript 9 | cout << v[i] << " "; | ^ pv.cpp:12:15: error: invalid types ‘int[int]’ for array subscript 12 | if (v[i] % 2 == 0) | ^ pv.cpp:13:28: error: invalid types ‘int[int]’ for array subscript 13 | div2 = div2 + v[i]; | ^ pv.cpp:14:13: error: ‘i’ was not declared in this scope 14 | if (i % 2 == 0) | ^ pv.cpp:16:15: error: ‘i’ was not declared in this scope 16 | if (v[i] % 10 == 0) | ^ pv.cpp:18:15: error: ‘i’ was not declared in this scope 18 | if (v[i] % 3 == 0 && i % 2 == 1) | ^ pv.cpp: At global scope: pv.cpp:21:5: error: ‘cout’ does not name a type 21 | cout << div2 << "\n"; | ^~~~ pv.cpp:22:5: error: ‘cout’ does not name a type 22 | cout << poz2 << "\n"; | ^~~~ pv.cpp:23:5: error: ‘cout’ does not name a type 23 | cout << div10 << "\n"; | ^~~~ pv.cpp:24:5: error: ‘cout’ does not name a type 24 | cout << div3poz1 ; | ^~~~ pv.cpp:25:5: error: expected unqualified-id before ‘return’ 25 | return 0; | ^~~~~~ pv.cpp:26:1: error: expected declaration before ‘}’ token 26 | } | ^
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ă.