2.4计算两个数字的积
#!perl -w
print "Enter the first number(a):";
chomp($a=<STDIN>);
print "Enter the second number(b):";
chomp($b=<STDIN>);
$c=$a*$b;
print "a*b is $c";
2.5 将某个字符串打印一定次数
#!perl -w
print "Enter the character to print:";
chomp($string_to_print=<STDIN>);
print "Enter times to print:";
chomp($times=<STDIN>);
$result=${string_to_print} x $times;
print "result is :$result";
2011-05-25 22:33
感谢大家的鼓励,这篇文章发表在网易博客上之后有人回复我哦.