From 436e85c49b29c0de4979c55d6bef93daf2aaf6b8 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Fri, 4 Dec 2020 13:22:03 -0600 Subject: Create test.go --- test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test.go diff --git a/test.go b/test.go new file mode 100644 index 0000000..9f5ad06 --- /dev/null +++ b/test.go @@ -0,0 +1,28 @@ +package main +import "fmt" + +func gcd(a, b int) int { + if b > 0 { + return gcd(b, a % b) + } else { + return a + } +} + +func main() { + fmt.Println("Hello World") + + const N int = 1000 + var A [N]int + for i := 0; i < N; i++ { + A[i] = i + } + + ans := 0 + for i := 0; i < N; i++ { + for j := 0; j < N; j++ { + ans += gcd(A[i], A[j]) + } + } + fmt.Println(ans) +} -- cgit v1.2.3-70-g09d2