mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
431 B
C++
25 lines
431 B
C++
#include <iostream>
|
|
using namespace std;
|
|
int main(){
|
|
int a,b;
|
|
while(cin>>a>>b){
|
|
int aa,bb,tmp;
|
|
if(a<b){
|
|
tmp=a;
|
|
a=b;
|
|
b=tmp;
|
|
}
|
|
aa=a;
|
|
bb=b;
|
|
while(b!=0){
|
|
tmp=a%b;
|
|
a=b;
|
|
b=tmp;
|
|
}
|
|
int lcm;
|
|
lcm=aa*bb/a;
|
|
cout<<lcm<<endl;
|
|
}
|
|
return 0;
|
|
}
|