#183
Să se ordoneze crescător elementele pătrat perfect ale unui şir dat, fără a afecta elementele care nu sunt pătrat perfect.
| Problema | sortPP | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64538382 | Utilizator | |
| Fișier | sortpp.cpp | Dimensiune | 449 B |
| Data încărcării | 13 Mai 2026, 09:44 | Scor/rezultat | Eroare de compilare |
sortpp.cpp: In function ‘int main()’: sortpp.cpp:11:79: error: expected ‘)’ before ‘{’ token 11 | if(a[i]>a[j]&&sqrt(a[i])==(int)sqrt(a[i])&&sqrt(a[j])==(int)sqrt(a[j]) | ~ ^ | ) 12 | {aux=a[i]; | ~ sortpp.cpp:11:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(a[i]>a[j]&&sqrt(a[i])==(int)sqrt(a[i])&&sqrt(a[j])==(int)sqrt(a[j]) | ^~ sortpp.cpp:16:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | for(i=1;i<=n;i++)cout<<a[i]<<" "; | ^ sortpp.cpp:16:21: warning: statement has no effect [-Wunused-value] 16 | for(i=1;i<=n;i++)cout<<a[i]<<" "; | ~^~~ sortpp.cpp:16:28: error: expected ‘;’ before ‘)’ token 16 | for(i=1;i<=n;i++)cout<<a[i]<<" "; | ^ | ; sortpp.cpp:6:13: warning: unused variable ‘aux’ [-Wunused-variable] 6 | int i,j,aux; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sortPP 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ă.