Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91413 | 孙嘉言 | 最大公约数(函数) | C++ | Accepted | 0 MS | 272 KB | 262 | 2024-09-21 17:50:39 |
#include <iostream> #include <cmath> using namespace std; int a(int x,int y){ int sb; while(x%y!=0) { sb=x%y; x=y; y=sb; }return sb; } int main(){ int n,m; cin>>n>>m; cout<< a(n,m); return 0; }