From d870dd2be3af6a1a1b859c3bc90485f1101019ac Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 12 Sep 2020 16:00:30 -0500 Subject: Add test.js --- test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test.js diff --git a/test.js b/test.js new file mode 100644 index 0000000..e12086c --- /dev/null +++ b/test.js @@ -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); -- cgit v1.2.3-70-g09d2