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