自己有点懒,为了便于记忆,就都贴出来啦。如果有需要的话,就直接从附件里下载

#!/usr/bin/perl
######第三章第一题答案#####
#print " input the number for a:\n";
#$a=<STDIN>;
#print " input the number for b:\n";
#$b=<STDIN>;
#print "you put the num is :\n";
#@lines=("$a","$b");
#print @lines;
#@lines_reverse=reverse@lines;
#print "the reverse num is :\n";
#print @lines_reverse;


#########第三章习题第二题的答案###########################
#@lines=qw(fred betty barney dino wilma pebbles bamm-bamm);
#$index=<STDIN>;
#print "$lines[$index-1]\n";

##########第三章第三题答案##################
$a=<STDIN>;
$b=<STDIN>;
$c=<STDIN>;
$d=<STDIN>;

@line=("$a","$b","$c","$d");
@sort_line=sort(@line);
print @sort_line;