#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 | #64701086 | Utilizator | |
| Fișier | sumsec.cpp | Dimensiune | 1.26 KB |
| Data încărcării | 24 Mai 2026, 22:30 | Scor/rezultat | Eroare de compilare |
sumsec.cpp: In function ‘int main()’: sumsec.cpp:10:25: error: expected ‘)’ before ‘;’ token 10 | for(int i=1;i<=n;i++;) | ~ ^ | ) sumsec.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(int i=1;i<=n;i++;) | ^~~ sumsec.cpp:10:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | for(int i=1;i<=n;i++;) | ^ sumsec.cpp:10:26: error: expected primary-expression before ‘)’ token sumsec.cpp:12:26: error: expected ‘)’ before ‘;’ token 12 | for (int i=1;i<=n;i++;){ | ~ ^ | ) sumsec.cpp:12:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for (int i=1;i<=n;i++;){ | ^~~ sumsec.cpp:12:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | for (int i=1;i<=n;i++;){ | ^ sumsec.cpp:12:27: error: expected primary-expression before ‘)’ token
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ă.