|
#!/usr/bin/perl
print "T\lHIS A GUESS NUMBER GAME.\n";
print "lease press <Enter> to start...\n";
<>;
print "lease input a number between 1 and 100: \n";
$number=<STDIN>;
if(1<=$number<=20){
print "This number is too small.Try again...\n";
$number=<STDIN>;
}elsif(21<=$number<=30){
print "This number is near the right one!Try again...\n";
$number=<STDIN>;
}elsif(31<=$number<=35){
print "Trust yourselt!You will get it soon!Continue...\n";
$number=<STDIN>;
}elsif(37<=$number<=50){
print "This number is near the right one!But it is bigger.Continue...\n";
$number=<STDIN>;
}elsif(51<=$number<=100){
print "What a pity!This number is too big!Try again...\n";
$number=<STDIN>
}else{
print "Congratulations!You are so clever!You get it!";
}
<>;
请指教,我不知道这个程序错在什么地方?
谢谢~~ |
|