C. f1二

1、前十名记分。2、某站比赛第一名到第10名取得的积分依次为25、18、15、12、10、8、6、4、2、1。现请你写一段程序来输出某站比赛过后，各某车手的排名。

``````10
CarlosSainz Renault 53
DanielRicciardo RedBullRacing 170
KevinMagnussen Haas 56
KimiRaikkonen Ferrari 251
LewisHamilton Mercedes 408
MaxVerstappen RedBullRacing 249
NicoHulkenberg Renault 69
SebastianVettel Ferrari 320
SergioPerez ForceIndia 62
ValtteriBottas Mercedes 247``````

``````LewisHamilton Mercedes 408
SebastianVettel Ferrari 320
KimiRaikkonen Ferrari 251
MaxVerstappen RedBullRacing 249
ValtteriBottas Mercedes 247
DanielRicciardo RedBullRacing 170
NicoHulkenberg Renault 69
SergioPerez ForceIndia 62
KevinMagnussen Haas 56
CarlosSainz Renault 53``````
``````#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct race
{
char st[30];
char st1[30];
int score;
};
int main()
{
int n,i,j,k;
typedef struct race ABC;
ABC per[21];
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
scanf("%s%s%d",per[i].st,per[i].st1,&per[i].score);
// for(i=0;i<n;i++)
// printf("%s %s %d\n",per[i].st,per[i].st1,per[i].score);
ABC tempStr;
int temp, loc;
for (loc = n - 1; loc >= 1; loc--)
{
for (i = 0; i < loc; i++)
{
if (per[i].score< per[i + 1].score)
{
tempStr = per[i];
per[i] = per[i + 1];
per[i + 1] = tempStr;
}
}
}

for(i=0;i<n;i++)
printf("%s %s %d\n",per[i].st,per[i].st1,per[i].score);
return 0;
}``````