2005-07-15から1日間の記事一覧

ID聞け 最新コンビネーション

sub combination { my $ary = shift; my $con = shift || []; my $first = shift @$ary; foreach my $e (@$ary) { push(@$con, [$first, $e]); } combination($ary, $con) if (scalar(@$ary)); return $con; } ["A","B","C"] を与えたら、[ ["A","B"], ["A",…