Aleksejs Posted February 28, 2011 Report Posted February 28, 2011 http://www.codeproject.com/KB/recipes/Combinatorics.aspx Quote
NBS Posted February 28, 2011 Author Report Posted February 28, 2011 (edited) Es jau visu googli esmu izmeklējis. Un šo piemēru arī skatījies, tas nestrādā. Jo nav tāda Combinations C#'ā. Varbūt ar php to var panākt. Ka katrus 100 000 ierakstus savo failā un turpina ģenerēt. Edited February 28, 2011 by NBS Quote
Aleksejs Posted February 28, 2011 Report Posted February 28, 2011 Mana pirmā atbilde un php funkcija base_convert(); http://php.net/manual/en/function.base-convert.php Quote
NBS Posted February 28, 2011 Author Report Posted February 28, 2011 Man jau nevajag neko convertēt. Quote
Aleksejs Posted February 28, 2011 Report Posted February 28, 2011 nu, tad taisi vienkārši 5 nestētos ciklus un miers. Quote
NBS Posted February 28, 2011 Author Report Posted February 28, 2011 Un ja man ir 36 simboli ? :D Un vajag 6 kombinācijas visiem šiem simboliem ? Quote
Aleksejs Posted February 28, 2011 Report Posted February 28, 2011 $rinda = 'qwertyuiopasdfghjklzxcvbnm1234567890'; for($simbols1=0;$simbols1<36;$simbols1++){ for($simbols2=0;$simbols2<36;$simbols2++){ for($simbols3=0;$simbols3<36;$simbols3++){ for($simbols4=0;$simbols4<36;$simbols4++){ for($simbols5=0;$simbols5<36;$simbols5++){ echo $rinda[$simbols1].$rinda[$simbols2].$rinda[$simbols3].$rinda[$simbols4].$rinda[$simbols5]; } } } } } Bet nu, gatavojies datoru atstāt ieslēgtu tā pailgāk :) Quote
NBS Posted February 28, 2011 Author Report Posted February 28, 2011 O, stilā, pārveidoju uz C#. Jo php nevar pavilkt tādu daudzumu. Quote
Aleksejs Posted February 28, 2011 Report Posted February 28, 2011 Nu, vēlu veiksmi pasaules iekarošanā. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.