- 论坛徽章:
- 7
|
回复 1# 56836430
c: total 203, [ score >= 5: count = 149 ]
why? nide d length = 150 ?
why? nide e length = 450 ?
wode:
d: length 149
e: length 447
run: [ perl version >= 5.010 ]
perl abc.pl a b c d e- #!/usr/bin/perl
- use 5.010;
- my $score = 5;
- my @rw = qw< < < < > > > >;
- my ( $A, $B, $C, $D, $E ) = map { open my $f, shift @rw, $_; $f } @ARGV;
- my @pick = map { state $i = -1; $i++; $_ >= $score ? $i : () } <$C>;
- for ( [ $A, $D, 1 ], [ $B, $E, 3 ] ) {
- my ( $I, $O, $n ) = @$_;
- local $/ = '>'; <$I>;
- while (<$I>) {
- my ( $a, $b ) = split "\n", $_, 2;
- $b =~ tr/\n>//d;
- my @b = unpack "(A$n)*", $b;
- say $O '>', $a;
- say $O $_ for unpack '(A50)*', join '', @b[@pick];
- say $O '';
- }
- }
复制代码 |
|