Board logo

标题: [技术讨论] 【练习-020】根据输入列出组合 [打印本页]

作者: sxw    时间: 2011-10-11 01:23     标题: 【练习-020】根据输入列出组合

找到一个模块:
  1. use Math::Combinatorics;
  2. my @n = qw(a b c d e a b);
  3. my @p = permute(@n);
  4. print join "\n", map { join " ", @$_ } @p;
  5. print "\n共有",scalar @p,"个组合";
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2