Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84305 尚雨钒 最大公约数(函数) C++ Accepted 1 MS 276 KB 235 2024-07-15 15:14:52

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int gcd2(int n,int m) { int c = n%m; while(c!=0) { n=m; m=c; c=n%m; } return m; } int main() { int a,b; cin>>a>>b; cout<<gcd2(a,b)<<endl; return 0; }