填空题
请补充main()函数,该函数的功能是:输入两个正整数num1和num2,求这两个数的最大公约数和最小公倍数。
例如,若输入的两个正整数为12、4,则它们的最大公约数为4,最小公倍数为12。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在main()函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<stdio.h>
void main()
{
int a, b, num1, num2, t;
system('CLS');
printf('\nInput two numbers: \n');
scanf('%d, %d', &num1, &num2);
if(num1<num2)
{
a=num2;
b=num1;
}
else
{
a=num1;
b=num2;
}
while(______)
{
t=______
a=b;
b=t;
}
printf('greatest common divisor:
%d\n', a);
printf('least common multiple:
%d\n', ______);
}