Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130605 周荣浩 最大公约数(函数) C++ Accepted 2 MS 272 KB 229 2025-09-14 13:51:48

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int gyshu(int x,int y){ for(int i=x;i>=1;i--){ if(x%i==0&&y%i==0){ return i; break; } } } int main(){ int m,n; cin>>m>>n; cout<<gyshu(m,n); return 0; }