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