Int main ()
{
Int a, b, c, d, e;
The scanf (" % d % d ", & amp; A, & amp; B);
D=a, e=b;
If (a{
A, c=a=b, b=c.
}
While (b!=0)
{
C=a % b, a=b, b=c.
}
Printf (" \ n \ n % d % d ", a, d * e/a);
return 0;
}
CodePudding user response:
This is a find the least common multiple of two and the greatest common factor of the codeCodePudding user response:
D=a, e=b;A, c=a=b, b=c.
C=a % b, a=b, b=c.
Don't know what is the original, but I don't think so is to test the comma expression, so think this a few words of commas should be a semicolon, finishing the following code
# define _CRT_SECURE_NO_WARNINGS
#include
Int main ()
{
Int a, b, c, d, e;
The scanf (" % d % d ", & amp; A, & amp; B);
D=a;
E=b;
If (a & lt; B)//exchange, if less than b, then the two Numbers exchange
{
C=a;
A=b;
B=c.
}
While (b!=0)
{
C=a % b;//cycle:
A=b;
B=c.
}
Printf (" \ n \ n % d % d ", a, d * e/a);
return 0;
}
CodePudding user response:
if (a{
A, c=a=b, b=c.
}
This step is used to ensure a & gt;=b; Otherwise do exchange within the if
while (b!=0)
{
C=a % b, a=b, b=c.
}
This step can consider learning to the greatest common divisor of evaluation algorithm
CodePudding user response:
https://blog.csdn.net/qq_42302831/article/details/88587052CodePudding user response:
', 'to' of your block; '