小栢给大家谈谈学生作业管理系统,以及学生作业管理系统数据流图应用的知识点,希望对你所遇到的问题有所帮助。

1、我这}p=p->next;有个不多的,要吗?是我写的实训作业程序:#include #include #include int man=0;int j;char str[20];struct student{char id[11];int n1;int n2;int n3;int n4;int n5;int n6;int n7;int n8;int n9;int zong;int ping;}student[100],temp;void read(void){FILE cj;int i,k;man=0;while(1){printf("请输入要读取的文件:n");scanf("%s",&str);if((cj=fopen(str,"r"))==NULL){printf("打开失败n");}else{break;}}for(i=0;i{if(fscanf(cj,"%s %s %d %d %d %d %d %d %d %d %d",&student[i].id,&student[i].name,&student[i].n1,&student[i].n2,&student[i].n3,&student[i].n4,&student[i].n5,&student[i].n6,&student[i].n7,&student[i].n8,&student[i].n9)==-1){break;}man=man+1;}printf("从%s读取去了“%d”条记录n",str,man);for(k=0;k{student[k].zong=student[k].n1+student[k].n2+student[k].n3+student[k].n4+student[k].n5+student[k].n6+student[k].n7+student[k].n8+student[k].n9;{student[i].ping=student[i].zong/9;}fclose(cj);}void write(void){FILE cj;int i;char me;printf("请确认是否保存(是:y,否:任意键):n");scanf("%s",&me);if(me=='y'){if((cj=fopen(str,"w"))==NULL){printf("保存失败n");{fprintf(cj,"%s %s %d %d %d %d %d %d %d %d %dn",student[i].id,student[i].name,student[i].n1,student[i].n2,student[i].n3,student[i].n4,student[i].n5,student[i].n6,student[i].n7,student[i].n8,student[i].n9);}printf("存了“%d”条记录到%sn",man,str);fclose(cj);}elsereturn;}void se(void){FILE cj;int i;char me;printf("请输入新的文件名:n");scanf("%s",&str);printf("请确认是否保存(是:y,否:任意键):n");scanf("%s",&me);if(me=='y'){if((cj=fopen(str,"w"))==NULL){printf("保存失败n");{fprintf(cj,"%s %s %d %d %d %d %d %d %d %d %dn",student[i].id,student[i].name,student[i].n1,student[i].n2,student[i].n3,student[i].n4,student[i].n5,student[i].n6,student[i].n7,student[i].n8,student[i].n9);}printf("存了“%d”条记录到%sn",man,str);fclose(cj);}elsereturn;}void print(void){int i;for(i=0;iprintf("");printf("n");printf(" | 学号 姓名 1 2 3 4 5 6 7 8 9 平均分 总分 | n");for(i=0;i{printf(" | %10s %-6s %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d | n",student[i].id,student[i].name,student[i].n1,student[i].n2,student[i].n3,student[i].n4,student[i].n5,student[i].n6,student[i].n7,student[i].n8,student[i].n9,student[i].ping,student[i].zong);}for(i=0;iprintf("");printf("n");}void inquiry(void){int i;char id[10];while(1){printf("请输入要查人的学号或名字(输入-1即返回上一级):n");scanf("%s",&id);if(id[0]=='-'&&id[1]=='1'){printf("exitn");}else{for(i=0;i{if(strcmp(student[i].id,id)==0){j=i;}if(strcmp(student[i].name,id)==0){j=i;}j=-1;}if(j==-1){printf("无此人n");}else{printf(" | 学号 姓名 1 2 3 4 5 6 7 8 9 总分 平均分 | n");printf(" | %10s %-6s %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d | n",student[j].id,student[j].name,student[j].n1,student[j].n2,student[j].n3,student[j].n4,student[j].n5,student[j].n6,student[j].n7,student[j].n8,student[j].n9,student[i].ping,student[i].zong);}}}}void fail(void){int i;printf("有不及格成绩的学生为:n");for(i=0;i{if(student[i].n1{printf(" | %10s %-6s %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d | n",student[i].id,student[i].name,student[i].n1,student[i].n2,student[i].n3,student[i].n4,student[i].n5,student[i].n6,student[i].n7,student[i].n8,student[i].n9,student[i].ping,student[i].zong);}}}void comitor(void){int i,k;char m;printf("请选择干什么排序:n");printf("1.成绩1n");printf("2.成绩2n");printf("3.成绩3n");printf("4.成绩4n");printf("5.成绩5n");printf("6.成绩6n");printf("7.成绩7n");printf("9.成绩9n");printf("0.总成绩或平均成绩n");scanf("%s",&m);if(m=='0'){for(k=man;k>0;k--){if(student[i].zong{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='1'){for(k=man;k>0;k--){if(student[i].n1{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='2'){for(k=man;k>0;k--){if(student[i].n2{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='3'){for(k=man;k>0;k--){if(student[i].n3{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='4'){for(k=man;k>0;k--){if(student[i].n4{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='5'){for(k=man;k>0;k--){if(student[i].n5{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='6'){for(k=man;k>0;k--){if(student[i].n6{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='7'){for(k=man;k>0;k--){if(student[i].n7{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='8'){for(k=man;k>0;k--){if(student[i].n8{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}else if(m=='9'){for(k=man;k>0;k--){if(student[i].n9{temp=student[i];student[i]=student[i+1];student[i+1]=temp;}}}}elseprintf("无此功能n");}void raise(void){printf("请输入添加人的学号:n");scanf("%s",&student[man].id);printf("请输入添加人的姓名:n");scanf("%s",&student[man].name);printf("请输入添加人的成绩1:n");scanf("%d",&student[man].n1);printf("请输入添加人的成绩2:n");scanf("%d",&student[man].n2);printf("请输入添加人的成绩3:n");scanf("%d",&student[man].n3);printf("请输入添加人的成绩4:n");scanf("%d",&student[man].n4);printf("请输入添加人的成绩5:n");scanf("%d",&student[man].n5);printf("请输入添加人的成绩6:n");scanf("%d",&student[man].n6);printf("请输入添加人的成绩7:n");scanf("%d",&student[man].n7);printf("请输入添加人的成绩8:n");scanf("%d",&student[man].n8);printf("请输入添加人的成绩9:n");scanf("%d",&student[man].n9);student[man].zong=student[man].n1+student[man].n2+student[man].n3+student[man].n4+student[man].n5+student[man].n6+student[man].n7+student[man].n8+student[man].n9;student[man].ping=student[man].zong/9;man=man+1;}void alter(void){int i;char id[10];printf("请输入要修改人的学号:n");scanf("%s",&id);for(i=0;i{if(strcmp(student[i].id,id)==0){j=i;}j=-1;}if(j==-1){printf("无此人n");}else{printf("请输入要修改为的学号:n");scanf("%s",&student[j].id);scanf("%s",&student[j].name);printf("请输入要修改为的成绩1:n");scanf("%d",&student[j].n1);printf("请输入要修改为的成绩2:n");scanf("%d",&student[j].n2);printf("请输入要修改为的成绩3:n");scanf("%d",&student[j].n3);printf("请输入要修改为的成绩4:n");scanf("%d",&student[j].n4);printf("请输入要修改为的成绩5:n");scanf("%d",&student[j].n5);printf("请输入要修改为的成绩6:n");scanf("%d",&student[j].n6);printf("请输入要修改为的成绩7:n");scanf("%d",&student[j].n7);printf("请输入要修改为的成绩8:n");scanf("%d",&student[j].n8);printf("请输入要修改为的成绩9:n");scanf("%d",&student[j].n9);student[j].zong=student[j].n1+student[j].n2+student[j].n3+student[j].n4+student[j].n5+student[j].n6+student[j].n7+student[j].n8+student[j].n9;student[j].ping=student[j].zong/9;}}void deletes(){int i,k;char id[10];printf("请输入要删除人的学号:n");scanf("%s",&id);for(i=0;i{if(strcmp(student[i].id,id)==0){j=i;}j=-1;}if(j==-1){printf("无此人n");}else{for(k=j;k{student[j]=student[j+1];j=j+1;}man=man-1;}}void menu(void){int i;printf("n");for(i=0;iprintf(" ");for(i=0;iprintf("");for(i=0;iprintf(" ");printf("n");for(i=0;iprintf(" ");printf("# 1.显示学生成绩信息 6.查询不及格学生信息 #n");for(i=0;iprintf(" ");printf("# 2.按成绩由高到低排序 7.修改学生成绩信息 #n");for(i=0;iprintf(" ");for(i=0;iprintf(" ");printf("# 4.删除学生成绩信息 9.保存文件 #n");for(i=0;iprintf(" ");printf("# 5.查询学生成绩信息 -. 另存为 #n");for(i=0;iprintf(" ");printf("# +.退出 #n");for(i=0;iprintf(" ");for(i=0;iprintf("");for(i=0;iprintf(" ");printf("n");}intprintf("# 3.添加学生成绩信息 8.读取文件 #n"); main(void){char i;read();menu();while(1){printf("请输入要选择的需要功能的序列号(输入0显示菜单):n");scanf("%s",&i);if(i=='1'){print();}else if(i=='2'){comitor();print();}else if(i=='3'){raise();print();}else if(i=='4'){deletes();print();}else if(i=='5'){inquiry();}else if(i=='6'){fail();}else if(i=='7'){alter();print();}else if(i=='8'){read();}else if(i=='9'){write();}else if(i=='0'){menu();}else if(i=='+'){break;}else if(i=='-'){se();}else{printf("无此功能,请重新输入序列号n");}}return 0;}记事本文件:你可以随意起名,但要放在和程序同目录0615438101 顾佳 44 67 72 60 66 65 93 82 670615438103 金一宇 60 77 75 75 78 77 97 74 760615438104 李阳涛 50 76 66 73 74 80 92 89 740615438105 马凯 66 76 77 66 75 72 95 82 750615438108 徐磊 60 75 66 80 76 80 92 68 740615438109 杨浩 60 81 70 83 72 93 72 780615438110 于泽 61 75 78 70 87 73 84 92 770615438111 张昊 60 71 57 82 72 63 86 38 670615438112 张政 60 67 69 80 66 61 87 88 730615438114 周艨 61 69 71 38 74 77 76 89 670615438131 张楠 86 74 72 90 80 81 97 80 840615438132 王凡 29 68 48 35 46 76 88 62 54。

本文到这结束,希望上面文章对大家有所帮助。