#include <stdio.h>
typedef struct
{ int num;
char name[10];
}PERSON;
/**********found**********/
void fun(PERSON ___1___)
{
/**********found**********/
___2___ temp;
if(std[0].num>std[1].num)
{ temp=std[0]; std[0]=std[1]; std[1]=temp; }
if(std[0].num>std[2].num)
{ temp=std[0]; std[0]=std[2]; std[2]=temp; }
if(std[1].num>std[2].num)
{ temp=std[1]; std[1]=std[2]; std[2]=temp; }
}
main()
{ PERSON std[ ]={ 5,"Zhanghu",2,"WangLi",6,"LinMin" };
int i;
/**********found**********/
fun(___3___);
printf("\nThe result is :\n");
for(i=0; i<3; i++)
printf("%d,%s\n",std[i].num,std[i].name);
}
请大侠帮忙做下,谢谢!!·
2 回答

汪汪一只猫
TA贡献1629条经验 获得超8个赞
第一空,PERSON std[] 或者 PERSON *std,将学生数组作为参数,从后面的“std[0]”下标能够推断出参数是数组类型(指针类型);
第二空,PERSON temp,这一点从“temp=std[0];”可以推断出temp的类型;
第三空,fun(std),将std数组作为形参传入到函数。
- 2 回答
- 0 关注
- 7 浏览
添加回答
举报
0/150
提交
取消