Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
78330 陈昊然 15求两个数的最大公约数 C++ Accepted 1 MS 272 KB 194 2024-06-18 18:44:15

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a=1,s=0,d=0,f=0; cin>>s>>d; while(a<=s&&a<=d){ if(s%a==0&&d%a==0){ f=a; } a++; } cout<<f; return 0; }