Memorandums?

This blog is written about technical-discovery and daily-event.

PerlのAOJ [10000 - 10004]

AOJ(会津オンラインジャッジ)には、
Perlで問題提出ができないということで、
ここに解答を書いていきます。

Hello World

[Problem 10000]

print "Hello World\n";

XCubic

[Problem 10001]

print ((<STDIN>**3)."\n");

Rectangle

[Problem 10002]

<STDIN> =~ /(\d) *(\d)/g;
my ($a, $b) = ($1, $2);
print (($a*$b)." ".(2*$a+2*$b)."\n");

Small, Large, or Equal

[Problem 10003]

<STDIN> =~ /(\d) *(\d)/g;
print 'a < b' if ($1 < $2);
print 'a > b' if ($1 > $2);
print 'a == b' if ($1 == $2);
print "\n";

Watch

[Problem 10004]

chomp(my $s = <STDIN>);
my $h = int($s/3600);
my $m = int(($s-$h*3600)/60);
$s -= $h*3600 + $m*60;
print ($h.":".$m.":".$s."\n");