| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 163845 | 赵锦鹏 | 最大公约数(函数) | C++ | Accepted | 1 MS | 272 KB | 358 | 2026-10-31 10:45:22 |
#include<bits/stdc++.h> using namespace std; /* bool zs(int x) { if(x==1) return false; for(int i=2;i<=sqrt(x);i++) { if(x%i==0) { return false; } } return true; } */ int gys(int a,int b) { while(a%b) { int r=a%b; a=b; b=r; } return b; } int main() { int m,n; cin>>m>>n; cout<<gys(m,n); return 0; }