#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 | #62785253 | Utilizator | |
| Fișier | sumsec.cpp | Dimensiune | 1.79 KB |
| Data încărcării | 02 Februarie 2026, 13:56 | Scor/rezultat | Eroare de compilare |
sumsec.cpp:21:13: error: stray '#' in program d++;#include <bits/stdc++.h> ^ sumsec.cpp:4:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("sumsec.in"); ^ sumsec.cpp:5:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("sumsec.out"); ^ sumsec.cpp: In function 'int prim(int)': sumsec.cpp:21:14: error: 'include' was not declared in this scope d++;#include <bits/stdc++.h> ^ sumsec.cpp:21:23: error: 'bits' was not declared in this scope d++;#include <bits/stdc++.h> ^ sumsec.cpp:21:28: error: 'stdc' was not declared in this scope d++;#include <bits/stdc++.h> ^ sumsec.cpp:22:1: error: expected primary-expression before 'using' using namespace std; ^ sumsec.cpp:22:1: error: expected ';' before 'using' sumsec.cpp:24:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("sumsec.in"); ^ sumsec.cpp:25:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("sumsec.out"); ^ sumsec.cpp:28:1: error: a function-definition is not allowed here before '{' token { ^ sumsec.cpp:117:1: error: expected '}' at end of input } ^ sumsec.cpp:117:1: error: expected '}' at end of input sumsec.cpp:117:1: warning: no return statement in function returning non-void [-Wreturn-type]
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ă.