直接相乘再除以最小公约数(最小公约数用欧几里得算法)
#include<stdio.h>
int gcd(int a, int b){
int c;
while(b!=0){
c=a%b;
a=b;
b=c;
}
return a;
}
int main(){
int number1, number2;
scanf("%d %d", &number1, &number2);
int x = gcd(number1, number2);
printf("%d", number1*number2/x);
}