Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156389 郑雨心 最大公约数(函数) C++ Accepted 1 MS 268 KB 221 2026-06-28 11:54:44

Tests(10/10):


Code:

#include<iostream> #include<cmath> using namespace std; int main() { int a,b,c; cin>>a>>b; if(a>b) c=b; else c=a; for(int i=c;i>=1;i--){ if(a%i==0&&b%i==0){ cout<<i; break; } } return 0; }