学生管理系统c语言源代码
    学生管理系统 c语言源代码
    #include stdio.h
    #include dos.h
    #include string.h
    #include stdlib.h
    #include malloc.h
    #define SIZE 8php学生选课系统源码
    struct student
    {
    char name;
    char num;
    int score;
    float ave;
    struct student *next;
    }stu[SIZE],temp,s;
    void shuru()
    {
    int i,j,sum,length,flag=1,a;
    FILE *fp;
    while(flag==1)
    {
    printf(“Define a rangeclass number:");
    scanf("%d",
    printf("Input the total number of the class(a):");
    scanf("%d",length);
    if(lengtha)
    flag=0;
    }
    for(i=0;ilength;i++)
    {
    printf("\n请输入学生的信息:");
    printf("\n输入姓名:");
    scanf("%s",stu[i].name);
    printf("\n输入序号.:");
    scanf("%s",stu[i].num);
    printf("\n输入成绩:\n");
    sum=0;
    for(j=0;jj++)
    {
    printf("score %d:",j+1);
    scanf("%d",stu[i].score[j]);
    sum+=stu[i].score[j];
    }
    stu[i].ave=sum/3.0;
    }
    学生管理系统 c语言源代码
    fp=fopen("","w");
    for(i=0;ilength;i++)
    if(fwrite(stu[i],sizeof(struct student),1,fp)!=1)
    printf("File write error\n");
    fclose(fp);
    fp=fopen("","r");
    printf("\name\ NO. score1 score2 score3 sum ave\n");
    for(i=0;ilength;i++)
    {
    fread(stu[i],sizeof(struct student),1,fp);
    printf("%3s%5s%7d%7d%7d%7d%10.2f\n",stu[i].name,stu[i].num,stu[i].score,
    stu[i].score,stu[i].score,sum=stu[i].score+stu[i].score+stu[i].score
    ,stu[i].ave);
    }
    }
    void chaxun()
    { FILE *fp, *fp1;
    char n,name;
    int i,j,k,t,m,flag=1;
    if((fp=fopen("","r"))==NULL)
    {printf("Can not open the file.");
    exit(0);
    }
    printf("\noriginal data:\n");
    k=i;
    printf("\nPlease select the menu(1.number ):");