26-1
#includestruct job_exam{ int num; char name[20]; int exama; int examb; int total; }; int main(){ struct job_exam s[3] = {{1501 , "王虎" , 89 , 92} , {1502 , "李雪" , 92 , 93} , {1503 , "张扬" , 80 , 86}}; for(int i=0; i<3; i++){ s[i].total = s[i].exama + s[i].examb; } struct job_exam max = s[0]; //成绩最大值 for(int i=1; i<3; i++){ if(max.total < s[i].total){ max = s[i]; } } printf("最大值为:n"); printf("%dt%st%dt%dt%dn" , max.num , max.name , max.exama , max.examb , max.total); }
26-2
//用函数完成:查找最高总成绩的考生信息。 #includestruct job_exam{ int num; char name[20]; int exama; int examb; int total; }s[3] = {{1501 , "王虎" , 89 , 92} , {1502 , "李雪" , 92 , 93} , {1503 , "张扬" , 80 , 86}};; void find(struct job_exam *p) { *p=s[0]; for(int i=1;i<3;i++) if((*p).total



