| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157847 | 李沐阳 | 最大公约数(函数) | C++ | Accepted | 1 MS | 272 KB | 276 | 2026-08-18 14:39:39 |
#include<bits/stdc++.h> using namespace std; int gys(int x,int y){ int q,n; if(x>y) n=x; else n=y; for(int i=n;i>=1;i--){ if(x%i==0&&y%i==0){ q=i; break; } } return q; } int main(){ int m,n; cin>>m>>n; cout<<gys(n,m)<<endl; return 0; }