#2669
Se dă un vector cu n numere naturale. Să se determine câte dintre perechile de elemente din vector sunt formate din valori cu aceeași sumă a cifrelor.
| Problema | Count5 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64797209 | Utilizator | |
| Fișier | count5.cpp | Dimensiune | 336 B |
| Data încărcării | 02 Iunie 2026, 08:27 | Scor/rezultat | Eroare de compilare |
count5.cpp: In function ‘int main()’: count5.cpp:14:11: error: expected ‘;’ before ‘}’ token 14 | x=x/10} | ^ | ; count5.cpp:15:4: error: ‘a’ was not declared in this scope 15 | a[1]=x;} | ^ count5.cpp:16:13: warning: right operand of comma operator has no effect [-Wunused-value] 16 | for(i=0,i<n-2;i++){ | ~^~~~ count5.cpp:16:21: error: expected ‘;’ before ‘)’ token 16 | for(i=0,i<n-2;i++){ | ^ | ; count5.cpp:17:9: error: ‘j’ was not declared in this scope 17 | for(j=i+1;j<n;i++) | ^ count5.cpp:19:11: error: ‘a’ was not declared in this scope 19 | if(a[i]==1])db++; | ^ count5.cpp:19:18: error: expected ‘)’ before ‘]’ token 19 | if(a[i]==1])db++; | ~ ^ | ) count5.cpp:19:18: error: expected primary-expression before ‘]’ token count5.cpp:8:9: warning: unused variable ‘t’ [-Wunused-variable] 8 | int t[100001]; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Count5 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ă.