#298
SumSec
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 | #55089286 | Utilizator | |
Fișier | sumsec.cpp | Dimensiune | 502 B |
Data încărcării | 22 Decembrie 2024, 02:30 | Scor / rezultat | Eroare de compilare |
sumsec.cpp:6:1: error: expected ',' or ';' before 'ofstream' ofstream g("sumsec.in") ^ sumsec.cpp: In function 'int main()': sumsec.cpp:12:8: error: 'n' was not declared in this scope f>>n; ^ sumsec.cpp:13:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) f>>v[i]; ^ sumsec.cpp:13:26: error: 'v' was not declared in this scope for(i=1;i<=n;i++) f>>v[i]; ^ sumsec.cpp:14:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ sumsec.cpp:16:9: error: 'ok' was not declared in this scope ok=1; ^ sumsec.cpp:17:12: error: 'v' was not declared in this scope if(v[i]<2) ok=0; ^ sumsec.cpp:18:13: error: 'd' was not declared in this scope for(d=2;d*d<=v[i];d++) ^ sumsec.cpp:18:22: error: 'v' was not declared in this scope for(d=2;d*d<=v[i];d++) ^ sumsec.cpp:20:21: error: 'k' was not declared in this scope if(ok==0 && k==0) {p=i; k=1;} ^ sumsec.cpp:20:28: error: 'p' was not declared in this scope if(ok==0 && k==0) {p=i; k=1;} ^ sumsec.cpp:21:21: error: 'k' was not declared in this scope if(ok==0 && k==1) u=i; ^ sumsec.cpp:21:27: error: 'u' was not declared in this scope if(ok==0 && k==1) u=i; ^ sumsec.cpp:24:9: error: 'i' was not declared in this scope for(i=p;i<=u;i++) s+=v[i]; ^ sumsec.cpp:24:11: error: 'p' was not declared in this scope for(i=p;i<=u;i++) s+=v[i]; ^ sumsec.cpp:24:16: error: 'u' was not declared in this scope for(i=p;i<=u;i++) s+=v[i]; ^ sumsec.cpp:24:23: error: 's' was not declared in this scope for(i=p;i<=u;i++) s+=v[i]; ^ sumsec.cpp:24:26: error: 'v' was not declared in this scope for(i=p;i<=u;i++) s+=v[i]; ^ sumsec.cpp:25:5: error: 'g' was not declared in this scope g<<s; ^ sumsec.cpp:25:8: error: 's' was not declared in this scope g<<s; ^
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ă.