寒假【perl语言学习脚本】2.1,2.2,2.3,2.4,2.5
突然发现****的代码直接复制粘贴会缺失$这个符号在开头
还自动放大和缩小一些字符,很难看阿
直接截图吧,有点难受这样,看着不太对
############################################
#ex2-1.pl
#!/usr/bin/perl
use warnings;
$pi=3.141592654;
pi*12.5;
print “the circumference of a circle of radius 12.5 is $circ.\n”;
############################################
#ex2-2.pl
#!/usr/bin/perl
use warnings;
print “what is the radius?”;
chomp($radius=);
$pi=3.141592654;
pi*$radius;
print “the circumference of a circle of radius 12.5 is $circ.\n”;
############################################
#ex2-3.pl
#!/usr/bin/perl
use warnings;
print “what is the radius?”;
chomp($radius=);
$pi=3.141592654;
pi*radius<0){
$circ=0;
}
print “the circumference of a circle of radius 12.5 is $circ.\n”;
############################################
#ex2-4.pl
#!/usr/bin/perl -w
print “enter first number:”;
chomp(two=);
one*$two;
print “the result is $result.\n”;
############################################
#ex2-5.pl
#!/usr/bin/perl
use warnings;
print “enter a string:”;
num=);
str x KaTeX parse error: Expected 'EOF', got '\n' at position 27: …"the result is:\̲n̲result ";