#include<stdio.h>
int main(void){
int a,b,i;
while(scanf("%d%d",&a,&b)!=EOF){
if(a>b){i=a;a=b;b=i;}
for(i=a;i>=1;i--)
if(a%i==0&&b%i==0)break;
printf("%d\n",a*b/i);
}
return 0;
}
HDU-1108
最新推荐文章于 2018-08-29 20:30:33 发布
#include<stdio.h>
int main(void){
int a,b,i;
while(scanf("%d%d",&a,&b)!=EOF){
if(a>b){i=a;a=b;b=i;}
for(i=a;i>=1;i--)
if(a%i==0&&b%i==0)break;
printf("%d\n",a*b/i);
}
return 0;
}