Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
116295 王珠潏 最大公约数(函数) C++ Accepted 1 MS 272 KB 267 2025-04-07 20:48:20

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; /** for(int i=2;i<=m;i++){ /**if(m%i==0 && n%i==0){ cout<<i<<" "; } }**/ while(m%n!=0){ int zz; zz=m%n; m=n; n=zz; } cout<<n; return 0; }