#298
Se dă un şir format din n elemente, numere naturale. Calculaţi suma elementelor din secvenţa determinată de primul şi ultimul element prim.
| Problema | SumSec | Operații I/O |
sumsec.in/sumsec.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64283729 | Utilizator | |
| Fișier | sumsec.cpp | Dimensiune | 508 B |
| Data încărcării | 27 Aprilie 2026, 23:48 | Scor/rezultat | 0 puncte |
sumsec.cpp: In function ‘int prim(int)’: sumsec.cpp:8:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 8 | if(n%d==0) | ^~ sumsec.cpp:10:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 10 | return 1; | ^~~~~~ sumsec.cpp: In function ‘int main()’: sumsec.cpp:27:8: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 27 | for(i=p1;i<=p2;i++) | ^~~ sumsec.cpp:29:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 29 | cout<<s; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumSec 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ă.