fork download
  1. use strict;
  2. use warnings;
  3.  
  4. # answer: http://o...content-available-to-author-only...e.jp/qa/q6932517.html
  5.  
  6. my @suffixes = qw(s f);
  7.  
  8. while(my $line = <>) {
  9. my ($mark, $number) = split(/ /, $line);
  10. print ">$mark@suffixes[$. % 2]\n>$number";
  11. }
Success #stdin #stdout 0s 4728KB
stdin
A 1234
A 2345
B 3456
B 4567
stdout
>Af
>1234
>As
>2345
>Bf
>3456
>Bs
>4567