Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
103833 张黄源 公约数问题 C++ Accepted 1 MS 272 KB 240 2024-12-29 15:22:06

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int jc(int bcs,int cs){ int max; for(int i=1;i<=cs;i++){ if(bcs%i==0&&cs%i==0){ max=i; } } return max; } int main() { int a,b; cin>>a>>b; cout<<jc(a,b); return 0; }