C语言程序题,求答案,求完整源码,高悬赏 80
#include "stdio.h"
int main(int argc,char *argv[]){
int a[10][2]={{2018101,60},{2018102,88},{2018103,86},{2018104,75},
{2018105,98},{2018106,65},{2018107,93},{2018108,79},
{2018109,83},{2018110,84}},t[][2]={{0,90},{0,81},{0,93},{0,94}},i,j,k,r;
printf("\nCompetition at the provincial level stu-number is as follows:\n");
for(r=i=0;i<10;i++)//求参加省竞赛人员并获得省竞赛成绩
if(a[i][1]>85)
printf("\t%d\n",t[r++][0]=a[i][0]);
for(i=0;i<r;i++){//对省竞赛成绩由高到低排序
for(k=i,j=k+1;j<r;j++)
if(t[k][1]<t[j][1])
k=j;
if(k!=i)
j=t[k][0],t[k][0]=t[i][0],t[i][0]=j,j=t[k][1],t[k][1]=t[i][1],t[i][1]=j;
}
printf("\nThe national competition students stu-number is as follows:\n");
for(r=int(0.3*r+0.5),i=0;i<r;i++)
printf("\t%d\n",t[i][0]);
return 0;
}
代码图片和运行样例:
能帮忙加个注释吗。有点看不太懂