#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貢獻1898條經驗 獲得超8個贊
第一空,PERSON std[] 或者 PERSON *std,將學生數組作為參數,從后面的“std[0]”下標能夠推斷出參數是數組類型(指針類型);
第二空,PERSON temp,這一點從“temp=std[0];”可以推斷出temp的類型;
第三空,fun(std),將std數組作為形參傳入到函數。
- 2 回答
- 0 關注
- 138 瀏覽
添加回答
舉報
0/150
提交
取消