#!/usr/bin/env perl
#input radius
#if radius>=0 then return correct value of Circumfrence of a circle.
#else return 0
print "2.11[1])\nPlease enter radius:";
$radius=<STDIN>;
if($radius >= 0){
$out=$radius *2*3.141592654;
print "Circumfrence of a circle is:$out\n";
}
else{
print "Error! return value = 0\n";
}
沒有留言:
張貼留言