Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105991 | 胡海峰老师 | 最大公约数 | C++ | Accepted | 1 MS | 272 KB | 243 | 2025-01-15 10:45:01 |
#include <iostream> using namespace std; int main(){ int m,n; cin>>m>>n; int start=n; if(m<n) start =m; while( start>1) { if( m%start ==0 && n%start==0) break; start--; } cout<<start; return 0; }