Journal DarkKnightRadick's Journal: My Tribute to Douglas Adams 1
#!/usr/bin/perl -w
#I have a feeling the answer will be 42
print "I have a feeling the answer will be the answer to Life! The Universe! And Everything!\n";
print "Please input the first number:";
chomp($first_num = <stdin>);
print "Please input the second number:";
chomp($second_num = <stdin>);
$answer = $first_num * $second_num;
if ($answer != 42) {
print "$first_num times $second_num is not the answer to Life! The Universe! And Everything! It's actually just $answer\n";
} else {
print "You know the answer to Life! The Universe! And Everything!\n";
}
#I have a feeling the answer will be 42
print "I have a feeling the answer will be the answer to Life! The Universe! And Everything!\n";
print "Please input the first number:";
chomp($first_num = <stdin>);
print "Please input the second number:";
chomp($second_num = <stdin>);
$answer = $first_num * $second_num;
if ($answer != 42) {
print "$first_num times $second_num is not the answer to Life! The Universe! And Everything! It's actually just $answer\n";
} else {
print "You know the answer to Life! The Universe! And Everything!\n";
}
My Tribute to Douglas Adams More Login
My Tribute to Douglas Adams
Slashdot Top Deals