填空题
函数fun()的功能是:从3个形参a,b,c中找出中间的那个数,作为函数值返回。
例如,当a=3,b=5,c=4时,中问的数为4。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在fun()函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
int fun(int a, int b, int c)
{
int t;
t=(a>b)?(b>c? b:(a>c? c:
1));
((a>c)?
2: ((h>c)? c:
3));
return t;
}
void main()
{
int a1=3, a2=5, a3=4, r;
r=fun(a1, a2, a3);
printf("/nThe middle number is: %d/n", r);
}