Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132179 蔡胤泽 最大公约数 C++ Accepted 0 MS 268 KB 274 2025-10-07 11:06:41

Tests(1/1):


Code:

#include <iostream> using namespace std; int main(){ int m, n; cin >> m; cin >> n; int x; if(m > n) { x = n; } else { x = m; } while(x > 1) { if(m % x == 0 && n % x == 0) break; x = x - 1; } cout << x; return 0; }