Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159751 张晓冉 最大公约数(函数) C++ Accepted 1 MS 268 KB 312 2026-09-06 15:11:14

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; int i = 1; int s = 1; while(i <= b){ i++; if(a % i == 0 && b % i == 0){ if(i > s){ s = i; } } } cout<<s<<endl; return 0; }