#163
Să se șteargă dintr-un vector toate elementele care sunt numere prime.
| Problema | stergere | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64396293 | Utilizator | |
| Fișier | stergere.cpp | Dimensiune | 433 B |
| Data încărcării | 05 Mai 2026, 09:34 | Scor/rezultat | Eroare de compilare |
stergere.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude <iostream> | ^~~~~~~ | include stergere.cpp: In function ‘int main()’: stergere.cpp:7:11: error: expected unqualified-id before ‘[’ token 7 | int n,[10001],d,j,h,i; | ^ stergere.cpp:8:5: error: ‘cin’ was not declared in this scope 8 | cin>>n; | ^~~ stergere.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? +++ |+#include <iostream> 1 | #inlcude <iostream> stergere.cpp:9:9: error: ‘i’ was not declared in this scope 9 | for(i=1;i<=n;i++) | ^ stergere.cpp:10:14: error: ‘a’ was not declared in this scope 10 | cin>>a[i]; | ^ stergere.cpp:11:5: error: ‘i’ was not declared in this scope 11 | i=1; | ^ stergere.cpp:12:8: error: ‘d’ was not declared in this scope 12 | do{d=0; | ^ stergere.cpp:13:12: error: ‘j’ was not declared in this scope 13 | for(j=1;j<=a[i];j++) | ^ stergere.cpp:13:19: error: ‘a’ was not declared in this scope 13 | for(j=1;j<=a[i];j++) | ^ stergere.cpp:13:8: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(j=1;j<=a[i];j++) | ^~~ stergere.cpp:16:12: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 16 | if(d==2) | ^~ stergere.cpp:17:13: error: ‘h’ was not declared in this scope 17 | {for(h=i+1lh<=n;h++) | ^ stergere.cpp:17:17: error: unable to find numeric literal operator ‘operator""lh’ 17 | {for(h=i+1lh<=n;h++) | ^~~ stergere.cpp:17:17: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes stergere.cpp:17:27: error: expected ‘;’ before ‘)’ token 17 | {for(h=i+1lh<=n;h++) | ^ | ; stergere.cpp:18:12: error: ‘a’ was not declared in this scope 18 | a[h-1]=a[h]; | ^ stergere.cpp:21:9: error: ‘cout’ was not declared in this scope 21 | cout<<a[i]<<" "; | ^~~~ stergere.cpp:21:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? stergere.cpp:21:15: error: ‘a’ was not declared in this scope 21 | cout<<a[i]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema stergere 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ă.