aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/test.pl b/test.pl
new file mode 100644
index 0000000..565c052
--- /dev/null
+++ b/test.pl
@@ -0,0 +1,19 @@
+# Perl
+
+sub gcd {
+ if ($_[1] > 0) { return gcd($_[1], $_[0] % $_[1]); }
+ else { return $_[0]; }
+}
+
+print("test\n");
+
+$N = 1000;
+@A = (0..$N-1);
+
+$ans = 0;
+for my $i (@A) {
+ for my $j (@A) {
+ $ans += gcd($i, $j);
+ }
+}
+print($ans);