Kód: Vybrať všetko
system("pause"); Kód: Vybrať všetko
system("pause"); Kód: Vybrať všetko
#include <stdio.h>
#include <algorithm>
int main () {
int myints[] = {1,2,3,4,5};
printf ( "The 5! possible permutations with 5 elements:\n" );
sort (myints,myints+5);
do {
printf ( "%d %d %d %d %d", myints[0], myints[1], myints[2], myints[3], myints[4] );
} while ( next_permutation (myints,myints+5) );
getchar();
return 0;
}
c-ice napísal:ak ste si vsimli jeho kod tak on vytvara okienkovy projekt a totalne na*icu to donho pcha a nema ani sajny co robi vobec vobec nic proste to je nula bodov a ako podla mna od neho chcu aby ten algoritmus ktory implementuje funkcia next_permutation mal vlastnorucne nakodeny lebo tychto par riadkov robi to co potrebuje lenze programatorskej prace je na tom 0 a take bude aj bodove ohodnotenie ...
ale keby tu ponukne seriozne 10€ tak sa stavim ze do hodiny to ma hotove od niekoho
Kód: Vybrať všetko
... a nie nerobi ti to to co si popisal na zaciatku ze potrebujes ... aby si mal kombinaciu 2 3 4 5 6 cisel tak minimalne musis zacat 2 alebo ku kazdemu cislu pri vypise pricitat +1 ale to je len detail :) ak to funguje tak CongratulationKód: Vybrať všetko
cout << i+1 << j+1 << k+1 << l+1 << m+1 << endl;
Kód: Vybrať všetko
int c = 0;
ui->label->clear();
char xs[] = "12";
do
{
ui->label->setText(ui->label->text()+ xs + " " );
c++;
}
while (std::next_permutation(xs,xs + sizeof(xs) -1));
ui->label_2->setNum(c);
ui->label_2->setText(ui->label_2->text()+ " možností");Kód: Vybrať všetko
char xs[] = ui->lineEdit->text();