Add test.pl

This commit is contained in:
Anthony Wang 2020-09-10 16:23:36 -05:00
parent bb6415b40f
commit 22e061794c
Signed by: a
GPG Key ID: 6FD3502572299774

19
test.pl Normal file
View File

@ -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);