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; +}