Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164955 王垚植 15求两个数的最大公约数 C++ Accepted 3 MS 272 KB 243 2026-11-08 13:44:34

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; for (int i=max(n,m);i>=0;i--){ if (n%i==0 && m%i==0){ cout<<i<<'\n'; return 0; } } return 0; }