]> git.rmz.io Git - dotfiles.git/blobdiff - bin/old/meme-math.pl
cleaning up bin
[dotfiles.git] / bin / old / meme-math.pl
diff --git a/bin/old/meme-math.pl b/bin/old/meme-math.pl
new file mode 100755 (executable)
index 0000000..7fe6aad
--- /dev/null
@@ -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";