#2858
Se consideră un șir a1, a2, …, an de numere naturale.
10.3 și aflate pe poziții impare.| Problema | pv | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64750396 | Utilizator | |
| Fișier | pv.cpp | Dimensiune | 404 B |
| Data încărcării | 27 Mai 2026, 18:10 | Scor/rezultat | Eroare de compilare |
pv.cpp:2:17: error: ‘atd’ is not a namespace-name 2 | using namespace atd; | ^~~ pv.cpp: In function ‘int main()’: pv.cpp:5:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 5 | cin>>n; | ^~~ | std::cin In file included from pv.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ pv.cpp:9:2: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 9 | cout<<v[i]<<" "; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ pv.cpp:11:16: error: expected primary-expression before ‘=’ token 11 | if(v[i]%==0) | ^ pv.cpp:12:7: error: ‘s’ was not declared in this scope 12 | s=s+v[i]; | ^ pv.cpp:10:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=n;i++) | ^~~ pv.cpp:13:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | cout<<"\n"; | ^~~~ pv.cpp:13:7: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 13 | cout<<"\n"; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ pv.cpp:20:6: error: ‘s’ was not declared in this scope 20 | s+=v[i]; | ^ pv.cpp:4:17: warning: unused variable ‘s1’ [-Wunused-variable] 4 | {int n,v[101],i,s1=0,s2=0,s3=0,k=0; | ^~ pv.cpp:4:22: warning: unused variable ‘s2’ [-Wunused-variable] 4 | {int n,v[101],i,s1=0,s2=0,s3=0,k=0; | ^~ pv.cpp:4:32: warning: unused variable ‘k’ [-Wunused-variable] 4 | {int n,v[101],i,s1=0,s2=0,s3=0,k=0; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pv 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ă.