Add test.rb

This commit is contained in:
Anthony Wang 2020-09-13 10:43:14 -05:00
parent d870dd2be3
commit 159c04404b
Signed by: a
GPG key ID: 6FD3502572299774

25
test.rb Normal file
View file

@ -0,0 +1,25 @@
# Ruby
def gcd(a, b)
if (b > 0)
return gcd(b, a % b)
else
return a
end
end
print "test\n"
N = 1000
A = []
for i in 0..N - 1
A[i] = i
end
ans = 0
for i in A
for j in A
ans += gcd(i, j)
end
end
print ans