C++ :
#include<bits/stdc++.h> using namespace std; long long a,b,c,a1,b1; int main() { // freopen("1017.in","r",stdin); // freopen("1017.out","w",stdout); cin>>a>>b; a1=a,b1=b; c=a%b; while(c!=0) { a=b; b=c; c=a%b; } cout<<a1*b1/b;; return 0; }
By signing up a 大沥中心 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 大沥中心 universal account