Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
65236 李明择 15求两个数的最大公约数 C++ Accepted 2 MS 276 KB 237 2024-01-24 14:47:12

Tests(10/10):


Code:

# include<iostream> using namespace std; int main(){ int a,b,min; cin>>a>>b; if(a>b){ min=b; } else{ min=a; } while(min>0){ if(a%min==0 && b%min==0){ cout<<min; break; } min--; } return 0; }