aboutsummaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorAnthony Wang2020-09-02 11:36:52 -0500
committerAnthony Wang2020-09-02 11:36:52 -0500
commit400bdcc244fa32ac9dd9f50ec266f7d91e817308 (patch)
tree31bcb2e4c3eadf6aa84cdfe3e3b0452a4eea1929 /test.c
parent60f1f838d7f8980aca48e6f7c13c815def87acd7 (diff)
Create test.c
Diffstat (limited to 'test.c')
-rw-r--r--test.c31
1 files changed, 31 insertions, 0 deletions
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 <stdio.h>
+
+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);
+}