#406
Se dă un șir cu n numere naturale. Determinați câte dintre ele sunt prime și au suma cifrelor un număr prim.
| Problema | SumCifPrim | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64918590 | Utilizator | |
| Fișier | sumcifprim.cpp | Dimensiune | 1.19 KB |
| Data încărcării | 13 Iunie 2026, 11:30 | Scor/rezultat | Eroare de compilare |
sumcifprim.cpp: In function ‘int main()’: sumcifprim.cpp:27:47: error: expected ‘)’ before ‘;’ token 27 | for (int i = 3; i * i <= a; i = i + 2;) | ~ ^ | ) sumcifprim.cpp:27:10: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 27 | for (int i = 3; i * i <= a; i = i + 2;) | ^~~ sumcifprim.cpp:27:48: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 27 | for (int i = 3; i * i <= a; i = i + 2;) | ^ sumcifprim.cpp:27:48: error: expected primary-expression before ‘)’ token sumcifprim.cpp:57:50: error: expected ‘)’ before ‘;’ token 57 | for (int i = 3; i * i <= s; i = i + 2;) | ~ ^ | ) sumcifprim.cpp:57:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 57 | for (int i = 3; i * i <= s; i = i + 2;) | ^~~ sumcifprim.cpp:57:51: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 57 | for (int i = 3; i * i <= s; i = i + 2;) | ^ sumcifprim.cpp:57:51: error: expected primary-expression before ‘)’ token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumCifPrim 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ă.