乘法

2016-10-11 19:54:34来源:CSDN作者:g13731463274人点击

[root@mysql1 perl]# cat 12.pl 
#!/usr/bin/env perl


print "enter first number: ";
chomp($one=<STDIN>);
print "enter second number: ";
chomp($two=<STDIN>);
$result=$one * $two;
print "the result is $result./n";


[root@mysql1 perl]# ./12.pl   
enter first number: 0
enter second number: 2
the result is 0.
[root@mysql1 perl]# ./12.pl 
enter first number: 2
enter second number: 3
the result is 6.
[root@mysql1 perl]# ./12.pl 
enter first number: a
enter second number: 2
the result is 0.

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台