From 22e061794c8f163c8d4777a13c30f42d0122a262 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 10 Sep 2020 16:23:36 -0500 Subject: Add test.pl --- test.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test.pl 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); -- cgit v1.2.3-70-g09d2