#495
Constr2
Se dă un vector x
cu n
elemente, numere naturale. Să se construiască un alt vector, y
, care să conțină elementele prime din x
, în ordine inversă.
Problema | Constr2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53454851 | Utilizator | |
Fișier | constr2.cpp | Dimensiune | 549 B |
Data încărcării | 31 Octombrie 2024, 16:01 | Scor / rezultat | Eroare de compilare |
constr2.cpp:3:7: error: expected nested-name-specifier before 'name' using name space std; ^ constr2.cpp:3:7: error: 'name' has not been declared constr2.cpp:3:12: error: expected ';' before 'space' using name space std; ^ constr2.cpp:3:12: error: 'space' does not name a type constr2.cpp: In function 'int main()': constr2.cpp:7:5: error: 'cin' was not declared in this scope cin>>n; ^ constr2.cpp:7:5: note: suggested alternative: In file included from constr2.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ constr2.cpp:9:14: error: 'x' was not declared in this scope cin>>x[i]; ^ constr2.cpp:14:12: error: 'x' was not declared in this scope if(x[i]<2) ^ constr2.cpp:16:12: error: 'x' was not declared in this scope if(x[i]%2==0 && x[i]>2) ^ constr2.cpp:18:26: error: 'x' was not declared in this scope for(int d=3;d*d<=x[i];d+=2) ^ constr2.cpp:22:20: error: 'x' was not declared in this scope y[m++]=x[i]; ^ constr2.cpp:25:9: error: 'cout' was not declared in this scope cout<<y[i]<<" "; ^ constr2.cpp:25:9: note: suggested alternative: In file included from constr2.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ constr2.cpp:6:11: warning: unused variable 'v' [-Wunused-variable] int n,v[205],m,y[205]; ^ constr2.cpp:26:13: error: expected '}' at end of input return 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Constr2 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ă.