#510
SortPrime
Se dă un vector cu n
elemente, numere naturale. Afișați în ordine crescătoare valorile prime din vector.
Problema | SortPrime | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52693008 | Utilizator | |
Fișier | sortprime.cpp | Dimensiune | 361 B |
Data încărcării | 07 Octombrie 2024, 11:55 | Scor / rezultat | Eroare de compilare |
sortprime.cpp: In function 'int main()': sortprime.cpp:8:5: error: 'i' was not declared in this scope for(i=1;i<=n;i++)cin>>a[i]; ^ sortprime.cpp:11:9: error: 'i' was not declared in this scope for(i=1;i<=n-1;i++) ^ sortprime.cpp:12:12: error: 'x' was not declared in this scope if(x[i]>x[i+1]) ^ sortprime.cpp:14:10: error: 'x' was not declared in this scope swap(x[i];x[i+1]) ^ sortprime.cpp:14:12: error: 'i' was not declared in this scope swap(x[i];x[i+1]) ^ sortprime.cpp:14:21: error: expected ';' before ')' token swap(x[i];x[i+1]) ^ sortprime.cpp:16:1: error: expected 'while' before '{' token { ^ sortprime.cpp:16:1: error: expected '(' before '{' token sortprime.cpp:16:1: error: expected primary-expression before '{' token sortprime.cpp:16:1: error: expected ')' before '{' token sortprime.cpp:16:1: error: expected ';' before '{' token sortprime.cpp:18:8: error: overloaded function with no contextual type information for(div=1;div<=a[i]/2;div++) ^ sortprime.cpp:18:18: error: 'i' was not declared in this scope for(div=1;div<=a[i]/2;div++) ^ sortprime.cpp:18:26: error: no post-increment operator for type for(div=1;div<=a[i]/2;div++) ^ sortprime.cpp:23:5: error: 'i' was not declared in this scope for(i=1;i<=n;i++) cout<<x[i]<<" "; ^ sortprime.cpp:23:25: error: 'x' was not declared in this scope for(i=1;i<=n;i++) cout<<x[i]<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortPrime 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ă.