aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2020-09-13 10:43:14 -0500
committerAnthony Wang2020-09-13 10:43:14 -0500
commit159c04404b7ee9609fdca63593983b454b13e649 (patch)
treee2565468198e398fef1bee0ce42ed07cacb1e1a3
parentd870dd2be3af6a1a1b859c3bc90485f1101019ac (diff)
Add test.rb
-rw-r--r--test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.rb b/test.rb
new file mode 100644
index 0000000..d6915e5
--- /dev/null
+++ b/test.rb
@@ -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