Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
8343 梅煦洋 求最大公约数(提高版) C++ 通过 100 6 MS 256 KB 237 2020-10-31 19:38:50

Tests(6/6):


#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,x,num=1; cin>>a>>b; for(int x=2;x<=a&&x<=b;){ if(a%x!=0||b%x!=0){ x++; continue; } a/=x; b/=x; num*=x; } cout<<num; return 0; }


测评信息: