#1608
Sortare Divizori
Se dau n
numere naturale nenule. Ordonați descrescător cele n
numere după numărul lor de divizori.
Problema | Sortare Divizori | Operații I/O |
sortare_divizori.in /sortare_divizori.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51654917 | Utilizator | |
Fișier | sortare_divizori.cpp | Dimensiune | 902 B |
Data încărcării | 29 Iulie 2024, 09:01 | Scor / rezultat | Eroare de compilare |
sortare_divizori.cpp:5:1: error: expected ',' or ';' before 'int' int n, v[1000],d[1000],i,aux1,aux2,j; ^ sortare_divizori.cpp: In function 'int main()': sortare_divizori.cpp:8:6: error: 'n' was not declared in this scope f>>n; ^ sortare_divizori.cpp:9:8: error: 'i' was not declared in this scope for (i=1;i<=n;i++) ^ sortare_divizori.cpp:10:7: error: 'v' was not declared in this scope {f>>v[i]; ^ sortare_divizori.cpp:11:3: error: 'd' was not declared in this scope d[i]=1; ^ sortare_divizori.cpp:12:8: error: 'j' was not declared in this scope for (j=1;j*j<=v[i];j++) ^ sortare_divizori.cpp:15:8: error: 'i' was not declared in this scope for (i=0;i<=n-2;i++) ^ sortare_divizori.cpp:16:10: error: 'j' was not declared in this scope for (j=i+1;j<=n-1;j++) ^ sortare_divizori.cpp:17:7: error: 'd' was not declared in this scope if (d[i]<d[j]) {aux1=d[i]; ^ sortare_divizori.cpp:17:19: error: 'aux1' was not declared in this scope if (d[i]<d[j]) {aux1=d[i]; ^ sortare_divizori.cpp:20:24: error: 'v' was not declared in this scope aux1=v[i]; ^ sortare_divizori.cpp:24:26: error: 'v' was not declared in this scope else if (d[i]==d[j]&&v[i]>v[j]) {aux2=v[i]; ^ sortare_divizori.cpp:24:38: error: 'aux2' was not declared in this scope else if (d[i]==d[j]&&v[i]>v[j]) {aux2=v[i]; ^ sortare_divizori.cpp:27:38: error: 'aux1' was not declared in this scope aux1=d[i]; ^ sortare_divizori.cpp:31:8: error: 'i' was not declared in this scope for (i=0;i<n;i++) g<<v[i]<<" "; ^ sortare_divizori.cpp:31:24: error: 'v' was not declared in this scope for (i=0;i<n;i++) g<<v[i]<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sortare Divizori 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ă.