| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70207 | 杨一诺 | 15求两个数的最大公约数 | C++ | Wrong Answer | 1 MS | 264 KB | 265 | 2024-04-14 09:48:33 |
#include<bits/stdc++.h> using namespace std; int main(){ int n=0,a,b,i,c,d; cin>>a>>b; if(a<b){ c=a; a=b; b=c; } for(i=0;i<a;i++){ d=a%b; if(d==0){ cout<<b; break; } else{ a=b; b=d; d=a%b; } } return 0; }
------Input------
49 47
------Answer-----
1
------Your output-----