#163
stergere
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 | #14345244 | Utilizator | |
Fișier | stergere.cpp | Dimensiune | 388 B |
Data încărcării | 01 Martie 2019, 11:33 | Scor / rezultat | Eroare de compilare |
stergere.cpp: In function 'int main()': stergere.cpp:6:10: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>n; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from stergere.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [1005]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ stergere.cpp:7:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(int i=1;i<=n;i++) ^ stergere.cpp:9:14: error: 'v' was not declared in this scope cin>>v[i]; ^ stergere.cpp:11:11: error: 'p' was not declared in this scope while(p=n && p>n=1){ ^ stergere.cpp:14:11: error: 'p' was not declared in this scope if (a%p==0){ ^ stergere.cpp:15:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(int i=p;i<n;i++) ^ stergere.cpp:16:16: error: invalid types 'int[int]' for array subscript a[i]=a[i+1]; ^ stergere.cpp:16:23: error: invalid types 'int[int]' for array subscript a[i]=a[i+1]; ^ stergere.cpp:17:10: error: lvalue required as decrement operand n--; ^ stergere.cpp:20:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(int i=1; i<=n;i++) ^ stergere.cpp:22:18: error: invalid types 'int[int]' for array subscript cout<<a[i]<<" "; ^ stergere.cpp:24:5: error: expected '}' at end of input } ^
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ă.