You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/usr/local/bin/perl
|
|
|
|
$integer = <STDIN>;
|
|
chop ($integer);
|
|
if ($integer !~ /^[0-9]+$|^0[xX][0-9a-fa-F]+$/) {
|
|
die ("$integer is not a legal integer\n");
|
|
}
|
|
if ($integer =~ /^0/) {
|
|
$integer = oct ($integer);
|
|
}
|
|
print ("$integer\n"); |