Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56370 | yuboyuan | 求最大公约数问题 | C++ | Accepted | 0 MS | 248 KB | 222 | 2024-11-10 18:42:28 |
#include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; while(a*b!=0) { if(a>=b) a%=b; else b%=a; } if(a==0) cout<<b; else cout<<a; return 0; }