Mám kombinátor čo kombinuje čísla a písmena ale veľmi ma zaujala jedna vec:
Keď do programu zadám napr. 1234 tak dostanem 24 možností čo je správne ale keď zadám 4321 dostanem len jednu možnosť a tak isto aj so Stringom. Ak chcem dostať správny výsledok musím pri číslach ich zadať v postupnosti a pri Stringu v abecednom poradí a tak sa pýtam prečo to tak je a dá sa to opraviť?
Cyklus kombinácie:
Rearranges the elements in the range [first, last) into the lexicographically next greater permutation of elements. The comparisons of individual elements are performed using either operator< for the first version, or comp for the second.
Pokial teda chces pouzivat next_permutation, musis to usporiadat od najmensieho po najvacsi. Ak ten vstup ziskavas od uzivatela, tak to predtym prezen nejakym sortom a bude to fungovat ako ma.