#include <stdio.h>
#include <string.h>
struct student
{
char name[100];
int a[3];
} std[10];
int main()
{
int i, j;
student s;
for ( i = 0; i < 10; i++)
{
scanf("%s %d %d %d",std[i].name, &std[i].a[0], &std[i].a[1], &std[i].a[2]);
}
for (i = 0; i < 9; i++)
{
for (j = 0; j < 10 - i -1; j++)
{
if (strcmp(std[j].name, std[j+1].name) < 0)
{
s = std[j], std[j] = std[j+1], std[j+1] = s;
}
}
}
for (i = 0; i< 10; i++)
{
printf("姓名:%s成绩:%d%d%d\n",std[i].name, std[i].a[0], std[i].a[1], std[i].a[2]);
}
return 0;
}
温馨提示:答案为网友推荐,仅供参考