diff options
author | Anthony Wang | 2020-09-12 16:00:30 -0500 |
---|---|---|
committer | Anthony Wang | 2020-09-12 16:00:30 -0500 |
commit | d870dd2be3af6a1a1b859c3bc90485f1101019ac (patch) | |
tree | 759a357d8ff64798848e6d7c7b240fc70a54964a /test.js | |
parent | 7d881a8f64cdef12df52276e008eb350737ef41b (diff) |
Add test.js
Diffstat (limited to 'test.js')
-rw-r--r-- | test.js | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +// Node.js + +function gcd(a, b) { + if (b > 0) return gcd(b, a % b); + else return a; +} + +console.log("test"); + +const N = 1000; +var A = []; +for (var i = 0; i < N; i++) { + A.push(i); +} + +var ans = 0; +for (i of A) { + for (j of A) { + ans += gcd(i, j); + } +} +console.log(ans); |