我编了个:
#include<stdio.h>
#include<string.h>
struct student
{
    char xuehao[20];
    char name [20];
    char sex;
    double score[3];
    double ave;
    double sum;
};
struct temp
{
    char xuehao[20];
    char name [20];
    char sex;
    double score[3];
    double ave;
    double sum;
}top;
int Insert(struct student stu[],int m)
{
    int i,j,k=0;
    scanf("%s %s %c",top.xuehao,top.name, &top.sex);
    top.sum=0;
    for(i=0; i<3; i++)
    {
        scanf("%lf", &top.score[i]);
        top.sum += top.score[i];
    }
    top.ave=top.sum/3;
    for(i=0;i<=m-1;i++)
    {
        if(strcmp(stu[i].xuehao,top.xuehao)==0 )
        {
            printf("Failed\n");
            k=1;
        }
    }
    if(k==0)
    {
        strcpy(stu[m].xuehao,top.xuehao);
        strcpy(stu[m].name,top.name);
        stu[m].sex=top.sex;
        for(j=0; j<3; j++)
        {
            stu[m].score[j]=top.score[j];
        }
        stu[m].ave=top.ave;
        stu[m].sum=top.sum;
    }
    return k;
}
void Find (struct student stu[],char a[],int n)
{
    int j,l=0,i,k;
    for (j=0;j<n;j++)
    {
        if (strcmp(stu[j].xuehao,a)==0)
        {
            l=1;
            k=j;
        }
    }
    if (l==1)
    {
        printf("%s %s %c ",stu[k].xuehao,stu[k].name,stu[k].sex);
        for(i=0; i<3; i++)
        {
            printf("%.2f ",stu[k].score[i]);
        }
        printf("%.2f %.2f\n",stu[k].ave,stu[k].sum);
    }
    if (l==0)
        printf ("Failed\n");
}
int Deleted(struct student a[],char b[],int n)
{
    struct student c[100];
    int i,j=0,k=0;
    int w=0;
    for(i=0;i<n;i++)
    {
        if(strcmp(a[i].xuehao,b)!=0)
        {
            c[k++]=a[i];
            j++;
        }
    }
    if(j==0)
    {
        printf("Failed\n");
        w=0;
    }
    else
    {
        printf("Deleted\n");
        for(i=0;i<k;i++)
            a[i]=c[i];
        w=1;
    }
    return w;
}
void List(struct student stu[], int n)
{
    int i,j;
    for(i=0;i<n;i++)
    {
        printf("%s %s %c ",stu[i].xuehao,stu[i].name,stu[i].sex);
        for(j=0;j<3;j++)
        {
            printf("%.2f ", stu[i].score[j]);
        }
        printf("%.2f %.2f\n",stu[i].ave,stu[i].sum);
    }
}
void output(struct student stu[],int m)
{
    int j;
    printf("%s %s %c ", stu[m].xuehao, stu[m].name, stu[m].sex);
    for(j=0; j<3; j++)
    {
        printf("%.2f ", stu[m].score[j]);
    }
    printf("%.2f %.2f\n", stu[m].ave, stu[m].sum);
}
void selSort(struct student *a, int n)
{
    int i, j, k;
    struct student t;
    for(i=0; i<n-1; i++)
    {
        k=i;
        for(j=i+1; j<n; j++)
            if (strcmp(a[k].xuehao,a[j].xuehao)>0)
                k=j;
        if(k != i)
        {
            t=a[i];
            a[i]=a[k];
            a[k]=t;
        }
    }
}
int main()
{
    struct student stu[100];
    char op[101];
    char a[20];
    char s[20];
    int b,p;
    int d=0;
    while(scanf("%s", op))
    {
        switch(op[0])
        {
            case 'I':
                b=Insert(stu,d);
                if(b==0)
                {
                    d++;
                    output(stu,d-1);
                }
                break;
            case 'L':
                selSort(stu,d);
                List(stu,d);
                break;
            case 'Q':
                printf("Good bye!\n");
                return 0;
            case 'F':
                scanf("%s",a);
                Find(stu,a,d);
                break;
            case 'D':
                scanf("%s",s);
                p=Deleted(stu,s,d);
                if(p==1)
                    d=d-1;
                break;
        }
    }
    return 0;
}
大家看看好不好?