Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Ask C++ God for help! Write a function lcm to calculate the least common multiple of two integers, which receives two shaping parameters and returns them.
Ask C++ God for help! Write a function lcm to calculate the least common multiple of two integers, which receives two shaping parameters and returns them.
# Contains? & ltstdio.h & gt

int? gcd(int? First,? int? b)

{

int? t;

And (b? & gt? 0)

{

Answer? %=? b;

t? =? b;

b? =? a;

Answer? =? t;

}

Return? a;

}

int? lcm(int? First,? int? b)

{

Return? a*b/gcd(a,b);

}

int? Master ()

{

int? Party A and Party B;

Scanf("%d%d ",&i, & b);

printf("lcm(%d,%d)? =? %d\n ",one? b,? lcm(a,b));

}