#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 | #54973583 | Utilizator | |
Fișier | sortare_divizori.cpp | Dimensiune | 847 B |
Data încărcării | 14 Decembrie 2024, 12:05 | Scor / rezultat | Eroare de compilare |
sortare_divizori.cpp:6:1: error: expected ',' or ';' before 'int' int n, j, i, a[1001], NRD[1001], nrd, d; ^ sortare_divizori.cpp: In function 'int main()': sortare_divizori.cpp:9:11: error: 'n' was not declared in this scope fcin>>n; ^ sortare_divizori.cpp:10:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ sortare_divizori.cpp:11:15: error: 'a' was not declared in this scope fcin>>a[i]; ^ sortare_divizori.cpp:12:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ sortare_divizori.cpp:14:9: error: 'nrd' was not declared in this scope nrd=0; ^ sortare_divizori.cpp:15:13: error: 'd' was not declared in this scope for(d=1; d*d<a[i]; d++) ^ sortare_divizori.cpp:15:22: error: 'a' was not declared in this scope for(d=1; d*d<a[i]; d++) ^ sortare_divizori.cpp:17:12: error: 'd' was not declared in this scope if(d*d==a[i])nrd++; ^ sortare_divizori.cpp:17:17: error: 'a' was not declared in this scope if(d*d==a[i])nrd++; ^ sortare_divizori.cpp:18:9: error: 'NRD' was not declared in this scope NRD[i]=nrd; ^ sortare_divizori.cpp:20:9: error: 'i' was not declared in this scope for(i=1; i<n; i++) ^ sortare_divizori.cpp:21:13: error: 'j' was not declared in this scope for(j=i+1; j<=n; j++) ^ sortare_divizori.cpp:22:16: error: 'NRD' was not declared in this scope if(NRD[i]<NRD[j]) ^ sortare_divizori.cpp:25:22: error: 'a' was not declared in this scope swap(a[i], a[j]); ^ sortare_divizori.cpp:27:40: error: 'a' was not declared in this scope else if(NRD[i]==NRD[j] and a[i]>a[j]) ^ sortare_divizori.cpp:32:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ sortare_divizori.cpp:33:16: error: 'a' was not declared in this scope fcout<<a[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ă.