From 60f1f838d7f8980aca48e6f7c13c815def87acd7 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Tue, 1 Sep 2020 12:30:28 -0500 Subject: Create test.cpp --- test.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test.cpp diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..dd4cb91 --- /dev/null +++ b/test.cpp @@ -0,0 +1,32 @@ +// C++ + +#include +#include + +inline int gcd(int a, int b) +{ + if (b > 0) return gcd(b, a % b); + else return a; +} + +int main() +{ + std::cout << "test\n"; + + const int N = 1000; + std::array A; + for (int i = 0; i < N; i++) + { + A[i] = i; + } + + int ans = 0; + for (int i : A) + { + for (int j : A) + { + ans += gcd(i, j); + } + } + std::cout << ans << std::endl; +} -- cgit v1.2.3-70-g09d2