Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
122140 | 田子熙 | 15求两个数的最大公约数 | C++ | Accepted | 1 MS | 272 KB | 236 | 2025-06-14 12:28:49 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s,m,s2; cin>>n>>m; s=n; while(s>=1){ if(n%s==0){ if(m%s==0){ cout<<s; return 0; } } s--; } cout<<endl; return 0; }