Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95397 朱安然 最大公约数 C++ Accepted 1 MS 268 KB 197 2024-10-27 14:30:23

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,m,c; cin>>n>>m; c=(n<m) ? n:m; while(c>0){ if(n % c == 0 && m % c==0){ break; } c--; } cout<<c<<endl; return 0; }