diff options
author | Anthony Wang | 2020-09-10 16:23:36 -0500 |
---|---|---|
committer | Anthony Wang | 2020-09-10 16:23:36 -0500 |
commit | 22e061794c8f163c8d4777a13c30f42d0122a262 (patch) | |
tree | 6424b8efda5bddf88c12c2befeeb90ddab370489 /test.pl | |
parent | bb6415b40f7d5a29361fa2a8568eabf8edab947b (diff) |
Add test.pl
Diffstat (limited to 'test.pl')
-rw-r--r-- | test.pl | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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); |