Aleksejs Posted February 28, 2011 Report Share Posted February 28, 2011 http://www.codeproject.com/KB/recipes/Combinatorics.aspx Quote Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share 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 Link to comment Share on other sites More sharing options...
Aleksejs Posted February 28, 2011 Report Share Posted February 28, 2011 Mana pirmā atbilde un php funkcija base_convert(); http://php.net/manual/en/function.base-convert.php Quote Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share Posted February 28, 2011 Man jau nevajag neko convertēt. Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 28, 2011 Report Share Posted February 28, 2011 nu, tad taisi vienkārši 5 nestētos ciklus un miers. Quote Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share Posted February 28, 2011 Un ja man ir 36 simboli ? :D Un vajag 6 kombinācijas visiem šiem simboliem ? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 28, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share Posted February 28, 2011 Ša ietestēšu. Quote Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share Posted February 28, 2011 O, stilā, pārveidoju uz C#. Jo php nevar pavilkt tādu daudzumu. Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 28, 2011 Report Share Posted February 28, 2011 Nu, vēlu veiksmi pasaules iekarošanā. :) Quote Link to comment Share on other sites More sharing options...
NBS Posted February 28, 2011 Author Report Share Posted February 28, 2011 Paldies :) Quote Link to comment Share on other sites More sharing options...
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.