EMSD1303测试答案(12)
发布时间:2021-06-07
发布时间:2021-06-07
分)
#include <stdio.h>
int main(void)
{
int a, b;
int tmp, gcl, lcm;
printf("Please input two numbers:");
scanf("%d %d", &a, &b);
int lcm_tmp = a * b;
if(a==b){
gcl=lcm=a;
printf("gcl=%d, lcm=%d\n", gcl, lcm);
return 0;
}
if(a<b){
a=a+b;
b=a-b;
a=a-b;
}
while((tmp = a%b)!=0){
a = b;
b = tmp;