中国大学MOOC: 写出下面程序执行后的运行结果。#include <stdio.h>struct STU {char name[10];int num;int Score;};int main(){struct STU s[5]={{"YangSan",20041,703},{"LiSiGuo",20042,580},{"wangYin",20043,680},{"SunDan",20044,550},{"Penghua",20045,537}},*p[5],*t;int i,j;for(i=0;i<5;i++) p[i]=&s[i];for(i=0;i<4;i++)for(j=i+1;j<5;j++)if(p[i]->Score>p[j]->Score){ t=p[i]; p[i]=p[j]; p[j]=t;}printf("%d %d",s[1].Score,p[1]->Score); return 0;}
中国大学MOOC: 写出下面程序执行后的运行结果。#include <stdio.h>struct STU {char name[10];int num;int Score;};int main(){struct STU s[5]={{"YangSan",20041,703},{"LiSiGuo",20042,580},{"wangYin",20043,680},{"SunDan",20044,550},{"Penghua",20045,537}},*p[5],*t;int i,j;for(i=0;i<5;i++) p[i]=&s[i];for(i=0;i<4;i++)for(j=i+1;j<5;j++)if(p[i]->Score>p[j]->Score){ t=p[i]; p[i]=p[j]; p[j]=t;}printf("%d %d",s[1].Score,p[1]->Score); return 0;}
1