#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 | #46110425 | Utilizator | |
Fișier | sortare_divizori.cpp | Dimensiune | 891 B |
Data încărcării | 03 Noiembrie 2023, 15:35 | Scor / rezultat | Eroare de compilare |
sortare_divizori.cpp:5:22: error: 'int div [1000]' redeclared as different kind of symbol int v[1000], div[1000]; ^ In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from sortare_divizori.cpp:1: /usr/include/stdlib.h:789:14: error: previous declaration of 'div_t div(int, int)' extern div_t div (int __numer, int __denom) ^ sortare_divizori.cpp: In function 'int main()': sortare_divizori.cpp:12:9: error: 'x' was not declared in this scope x=v[i]; ^ sortare_divizori.cpp:13:9: error: 'exp' was not declared in this scope exp=0; ^ sortare_divizori.cpp:14:9: error: 'nr' was not declared in this scope nr=1; ^ sortare_divizori.cpp:15:9: error: 'd' was not declared in this scope d=2; ^ sortare_divizori.cpp:27:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript div[i]=nr; ^ sortare_divizori.cpp:29:9: error: 'u' was not declared in this scope for(u=1;u<n;u++){ ^ sortare_divizori.cpp:31:9: error: 'p' was not declared in this scope p=u; ^ sortare_divizori.cpp:33:21: error: invalid types '<unresolved overloaded function type>[int]' for array subscript if(div[i]>div[p]){ ^ sortare_divizori.cpp:34:26: error: invalid types '<unresolved overloaded function type>[int]' for array subscript min=div[i]; ^ sortare_divizori.cpp:37:17: error: 'm' was not declared in this scope aux=div[m]; ^ sortare_divizori.cpp:42:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript fout<<div[i]<<" "; ^ sortare_divizori.cpp:8:11: warning: unused variable 'j' [-Wunused-variable] int i,j,n,aux; ^
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ă.