From 4bc93bb684c358c276c4644cf6cd146d513dfe81 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Thu, 19 Aug 2021 17:11:13 +0800 Subject: [PATCH] =?UTF-8?q?872.=20=E6=9C=80=E5=A4=A7=E5=85=AC=E7=BA=A6?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/7242550/ --- AcWing/872/872.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 AcWing/872/872.cpp diff --git a/AcWing/872/872.cpp b/AcWing/872/872.cpp new file mode 100644 index 00000000..3f7df07e --- /dev/null +++ b/AcWing/872/872.cpp @@ -0,0 +1,18 @@ +#include + +using namespace std; + +int gcd(int a, int b) { + if (!b) return a; + return gcd(b, a % b); +} + +int main() { + int n, a, b; + cin >> n; + while (n--) { + cin >> a >> b; + cout << gcd(a, b) << endl; + } + return 0; +}