Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
122135 | 刘益梵 | 15求两个数的最大公约数 | C++ | Accepted | 1 MS | 272 KB | 198 | 2025-06-14 12:20:50 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,s; cin>>a>>b; s=a; while(s>=1){ if(a%s==0 && b%s==0){ cout<<s; return 0; } s--; } return 0; }