Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
68483 李星熠 公约数问题 C++ Accepted 1 MS 272 KB 302 2024-03-23 14:58:55

Tests(10/10):


Code:

#include <iostream> using namespace std; int CommFactor1(int m, int n); int main() { int a, b; cin >> a >> b; cout <<CommFactor1(a,b)<< endl; return 0; } int CommFactor1(int m,int n) { int tem; for (tem = m;; tem--) { if (m % tem == 0 && n % tem == 0) { break; } } return tem; }