给定程序中,函数fun的功能是:将形参std所指结构体数组中年龄最大者的数据作为函数值返回,并在main函数中输出。
请在程序的下画线处填入正确的内容,并把下画线删除,使程序得出正确的结果。
[注意] 部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句。
[试题源程序]
#include<stdio.h>
typedef struct
char name[10];
int age;
)STD;
STD fun(STD std[], int n)
STD max; int i;
/**********found**********/
max= (1) ;
for(i=1; i<n; i++)
/**********found**********/
if(max.age< (2) )
max=std[i];
return max;
main()
STD std[5]="aaa", 17, "bbb", 16, "ccc", 18, "ddd", 17, "eee", 15;
STD max;
max=fun(std, 5);
printf("\nThe result: \n");
/**********found**********/
printf("\nName: %s, Age: %d\n", (3) , max.age);