Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
559 | 关清声 | 公约数问题 | C++ | Accepted | 0 MS | 256 KB | 281 | 2022-11-20 12:23:21 |
#include<iostream> using namespace std; int find(int x,int y,int c) { if(x%c==0&&y%c==0) { return c; } else { find(x,y,c-1); } } int main() { int a,b; cin>>a>>b; if(a>b) { cout<<find(a,b,a); } else { cout<<find(a,b,b); } return 0; }