Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3121 邓程允 最大公约数(函数) C++ Accepted 0 MS 264 KB 264 2024-04-05 18:44:24

Tests(10/10):


Code:

# include<iostream> # include<cmath> using namespace std; int a(int n,int m){ int b; for(int i=1;i<=max(n,m);i++){ if(n%i==0&&m%i==0)b=i; } return b; } int main(){ int n,m; cin>>n>>m; cout<<a(n,m); return 0; }