X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/61d7dd11d4a450a64f2817ee4db0ec7fa5880b42..b9e4a0c3af29391c27e9a020693541b9a86c4d14:/bin/old/meme-math.pl?ds=sidebyside diff --git a/bin/old/meme-math.pl b/bin/old/meme-math.pl new file mode 100755 index 0000000..7fe6aad --- /dev/null +++ b/bin/old/meme-math.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +my $start = time; +for (my $n = 0; $n < 100; $n++) { + my $f = $n - 25; + my $tmp = 50 - $n; + my $b = $tmp * $tmp; + + my $ans = $n * $n; + my $ans2 = sprintf("%02d%02d",$f,$b); + #my $ans2 = 100*$f+$b; + print "$n^2 = $ans => $ans2\n" unless $ans == $ans2; +} +my $end = time - $start; + +print "Execution Time: $end";