#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 | #64816706 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 604 B |
| Data încărcării | 03 Iunie 2026, 11:37 | Scor/rezultat | Eroare de compilare |
pv.cpp: In function ‘int main()’: pv.cpp:13:28: error: invalid types ‘int[int]’ for array subscript 13 | poz2 = poz2 + v[i]; | ^ pv.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for (int i = 1; i <= n; i++) | ^~~ pv.cpp:14:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 14 | if (v[i] % 10 == 0) | ^~ pv.cpp:14:15: error: ‘i’ was not declared in this scope 14 | if (v[i] % 10 == 0) | ^ pv.cpp:16:15: error: ‘i’ was not declared in this scope 16 | if (v[i] % 3 == 0 && i % 2 == 1) | ^ pv.cpp:4:21: warning: unused variable ‘div2’ [-Wunused-variable] 4 | int v, n, poz2, div2, div10, div3poz1; | ^~~~ pv.cpp: At global scope: pv.cpp:19:5: error: ‘cout’ does not name a type 19 | cout << div2 << "\n"; | ^~~~ pv.cpp:20:5: error: ‘cout’ does not name a type 20 | cout << poz2 << "\n"; | ^~~~ pv.cpp:21:5: error: ‘cout’ does not name a type 21 | cout << div10 << "\n"; | ^~~~ pv.cpp:22:5: error: ‘cout’ does not name a type 22 | cout << div3poz1 ; | ^~~~ pv.cpp:23:5: error: expected unqualified-id before ‘return’ 23 | return 0; | ^~~~~~ pv.cpp:24:1: error: expected declaration before ‘}’ token 24 | } | ^
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ă.