Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133272 王金檐 最大公约数(函数) C++ Accepted 1 MS 268 KB 189 2025-10-18 12:24:01

Tests(10/10):


Code:

#include <iostream> using namespace std; int n,m; int main (){ int max=1; cin>>n>>m; for(int i=1;i<n;i++){ if(n%i==0 && m%i==0){ max=i; } } cout<<max; return 0; }