#3481
Se dau n numere naturale. Să se afișeze acestea în ordinea crescătoare a numărului de divizori ai fiecăruia, la același număr de divizori crescător după cifra de control, la aceeași cifră de control crescător după prima cifră, iar dacă și prima cifră este aceeași atunci numerele se vor afișa în ordinea crescătoare a valorii lor.
| Problema | sort_div | Operații I/O |
sort_div.in/sort_div.out
|
|---|---|---|---|
| Limita timp | 0.02 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
| Id soluție | #64295204 | Utilizator | |
| Fișier | sort_div.cpp | Dimensiune | 1.62 KB |
| Data încărcării | 28 Aprilie 2026, 12:58 | Scor/rezultat | Eroare de compilare |
sort_div.cpp: In function ‘int main()’: sort_div.cpp:52:14: error: request for member ‘div’ in ‘vect’, which is of non-class type ‘numere [10001]’ 52 | vect.div=(numere)nrDiv(v[i]); | ^~~ sort_div.cpp:52:36: error: no matching function for call to ‘numere::numere(int)’ 52 | vect.div=(numere)nrDiv(v[i]); | ^ sort_div.cpp:40:8: note: candidate: ‘numere::numere()’ 40 | struct numere | ^~~~~~ sort_div.cpp:40:8: note: candidate expects 0 arguments, 1 provided sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(const numere&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘const numere&’ sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(numere&&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘numere&&’ sort_div.cpp:53:14: error: request for member ‘control’ in ‘vect’, which is of non-class type ‘numere [10001]’ 53 | vect.control=(numere)cifControl(v[i]); | ^~~~~~~ sort_div.cpp:53:45: error: no matching function for call to ‘numere::numere(int)’ 53 | vect.control=(numere)cifControl(v[i]); | ^ sort_div.cpp:40:8: note: candidate: ‘numere::numere()’ 40 | struct numere | ^~~~~~ sort_div.cpp:40:8: note: candidate expects 0 arguments, 1 provided sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(const numere&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘const numere&’ sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(numere&&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘numere&&’ sort_div.cpp:54:14: error: request for member ‘cif’ in ‘vect’, which is of non-class type ‘numere [10001]’ 54 | vect.cif=(numere)primaCif(v[i]); | ^~~ sort_div.cpp:54:39: error: no matching function for call to ‘numere::numere(int)’ 54 | vect.cif=(numere)primaCif(v[i]); | ^ sort_div.cpp:40:8: note: candidate: ‘numere::numere()’ 40 | struct numere | ^~~~~~ sort_div.cpp:40:8: note: candidate expects 0 arguments, 1 provided sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(const numere&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘const numere&’ sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(numere&&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘numere&&’ sort_div.cpp:55:14: error: request for member ‘nr’ in ‘vect’, which is of non-class type ‘numere [10001]’ 55 | vect.nr=(numere)v[i]; | ^~ sort_div.cpp:55:28: error: no matching function for call to ‘numere::numere(int&)’ 55 | vect.nr=(numere)v[i]; | ^ sort_div.cpp:40:8: note: candidate: ‘numere::numere()’ 40 | struct numere | ^~~~~~ sort_div.cpp:40:8: note: candidate expects 0 arguments, 1 provided sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(const numere&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘const numere&’ sort_div.cpp:40:8: note: candidate: ‘constexpr numere::numere(numere&&)’ sort_div.cpp:40:8: note: no known conversion for argument 1 from ‘int’ to ‘numere&&’ sort_div.cpp:72:39: warning: self-comparison always evaluates to false [-Wtautological-compare] 72 | if (vect[i].nr>vect[i].nr) | ~~~~~~~~~~^~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sort_div 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ă.