填空题
以下程序运行时,输出到屏幕的结果中第一行是
1
,第二行是
2
。
#include<iostream.h>
#include<math.h>
int fun(int a,int b)
{
int n;
while(a!=b)
{
n=abs(a-b);
a=(a>b)?b:a;
b=n;
}
return a;
}
void main()
{
cout<<fun(9,15)<<"/n"<<fun(9,5)<<endl;
}
【正确答案】
【答案解析】
3、1
提交答案
关闭