推 pqman:謝謝 不過您的語法對我來說有點難 我還要多學習! 05/01 22:02
#!/usr/bin/perl
$input = qq~a b c d e
f g h i j
1 2 3 4 5
6 7 8 9 10~;
my @array = map{\@{[split/\s+/]}} split/$\//,$input;
for my $i(0..$#array/2) {
for my $j(0..$#{$array[$i]}) {
print "$array[$i][$j] $array[$#array/2+1+$i][$j] ";
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.71.40