Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77567 sh25_zhuhy 求两个数的公约数 C++ 通过 0 MS 252 KB 258 2025-12-26 14:27:45

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int a,b,n,bomb; cin>>a>>b; n=1; for(bomb=1;bomb<=a&&bomb<=b;bomb++){ if(a%bomb==0&&b%bomb==0){ cout<<bomb<<" "; n+=1; }} cout<<endl; cout<<n-1; }


测评信息: