Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105 | Benson | 最大公约数(函数) | C++ | Wrong Answer | 0 MS | 264 KB | 335 | 2022-07-20 01:25:55 |
#include<iostream> #include<cmath> using namespace std; int gcd(int a,int b) { int c=0; if(a>b) c=b; else c=a; for(int i=c;i>=1;i--) { if(a%c==0&&b%c==0) return c; } } int main(){ int m,n; cin>>m>>n; cout<<gcd(m,n); return 0; }
------Input------
25 70
------Answer-----
5
------Your output-----
4195088