Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
128702 刘国洋 求最大公约数和最小公倍数 C++ Compile Error 0 0 MS 0 KB 204 2024-01-26 08:57:09

Tests(0/0):


#include<bits/stdc++.h > using namespace std; int main(){ int a,b,s,x,n; cin>>a>>b; s=a%b; x=a; n=b; while(s!=0) { a=b; b=s; s=a%b; } cout<<b<<" "<<x/b*n; return 0; }


Judgement Protocol: