Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1053 | 张宸瑞 | 15求两个数的最大公约数 | C++ | Accepted | 0 MS | 260 KB | 286 | 2023-07-01 14:30:14 |
#include <iostream> using namespace std; int main() { int a,b,m=0; cin>>a>>b; int max; if(b<a) { max=b; b=a; a=max; } while(a%b!=0) { m=a%b; a=b; b=m; } cout<<b; return 0; }