From 400bdcc244fa32ac9dd9f50ec266f7d91e817308 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Wed, 2 Sep 2020 11:36:52 -0500 Subject: Create test.c --- test.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test.c diff --git a/test.c b/test.c new file mode 100644 index 0000000..5a7edc4 --- /dev/null +++ b/test.c @@ -0,0 +1,31 @@ +// C + +#include + +inline int gcd(int a, int b) +{ + if (b > 0) return gcd(b, a % b); + else return a; +} + +int main() +{ + printf("test\n"); + + const int N = 1000; + int A[N]; + for (int i = 0; i < N; i++) + { + A[i] = i; + } + + int ans = 0; + for (int i = 0; i < N; i++) + { + for (int j = 0; j < N; j++) + { + ans += gcd(A[i], A[j]); + } + } + printf("%d\n", ans); +} -- cgit v1.2.3-70-g09d2