该算法将采用数字或单词并找到所有可能的组合

该算法将采用数字或单词并找到所有可能的组合,第1张

算法将采用数字或单词并找到所有可能的组合

看看http://pear.php.net/package/Math_Combinatorics

<?phprequire_once 'Math/Combinatorics.php';$words = array('cat', 'dog', 'fish');$combinatorics = new Math_Combinatorics;foreach($combinatorics->permutations($words, 2) as $p) {  echo join(' ', $p), "n"; }

版画

cat dogdog catcat fishfish catdog fishfish dog


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5559934.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存