| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 84272 | 石茂诤 | 最大公约数(函数) | C++ | Accepted | 1 MS | 272 KB | 353 | 2024-07-15 14:52:23 |
# include<bits/stdc++.h> # include<cmath> using namespace std; bool a(int j){ for(int i=2;i<=sqrt(j);i++){ if(j%i==0){ return false; } } return true; } int main (){ int n,m; cin>>n>>m; if(n==m){ cout<<n; return 0; } for(int i=n;i>0;i--){ if(m%i==0&&n%i==0){ cout<<i; return 0; } } return 0; }