c语言课程设计报告学生成绩管理系统 下载本文

system (\

do {

printf(\学号:\\n\

scanf(\ numcheck=1;

if(stu[count].num<0)

printf(\请输入正整数:\\n\ for(i=0;i

if(stu[count].num==stu[i].num) {

numcheck=0;

printf(\学号重复,重新输入:\\n\ } }

}while(!numcheck); printf(\姓名:\\n\ fflush(stdin);

gets(stu[count].name); for(i=0;i<3;i++) {

printf(\第%d门课成绩:\\n\ scanf(\ }

stu[count].avg=(stu[count].score[0]+stu[count].score[1]+stu[count].score[2])/3; printf(\是否继续输入(y/n):\\n\ do {

c=getchar(); if(c=='y'||c=='Y') {

count++; if(count<10) input();

else {

printf(\记录数已满\\n\ Sleep(2000); system(\ homepage(); }

}

else if(c=='n'||c=='N') {

count++;

system(\ homepage(); } else;

}while((c!='y')&&(c!='n')&&(c!='Y')&&(c!='N')); }

void del() {

int i,j,del_num,match=0; char c;

system(\

printf(\请输入要删除的学生学号:\\n\ scanf(\ waiting();

for(i=0;i

if(stu[i].num==del_num) {

match=1;

for(j=i;j

stu[j].num=stu[j+1].num;

strcpy(stu[j].name,stu[j+1].name); stu[j].score[0]=stu[j+1].score[0]; stu[j].score[1]=stu[j+1].score[1]; stu[j].score[2]=stu[j+1].score[2]; stu[j].avg=stu[j+1].avg; }*/

stu[j]=stu[j+1]; } }

if(!match)

printf(\没有要找的学号.\\n\ printf(\是否继续删除?(y/n)\ fflush(stdin); do

{

c=getchar(); if(c=='y'||c=='Y')

{

count--; del(); }

else if(c=='n'||c=='N') {

count--;

system(\ homepage(); } else;

}while((c!='y')&&(c!='n')); }

void sort() {

int i,j; int choice;

struct student temp; system(\

printf(\请选择排序功能:\\n\ printf(\按学号排序\\n\ printf(\按成绩1排序\\n\ printf(\按成绩2排序\\n\ printf(\按成绩3排序\\n\ printf(\按平均成绩排序\\n\ do {

scanf(\

}while((choice!=1)&&(choice!=2)&&(choice!=3)&&(choice!=4)&&(choice!=5)); switch(choice) {

case 1: {

for(i=0;i

for(j=0;j

if(stu[j].num>stu[j+1].num) {

temp=stu[j]; stu[j]=stu[j+1]; stu[j+1]=temp;

} } }

sort_type=1; break; }

case 2: {

for(i=0;i

for(j=0;j

if(stu[j].score[0]

temp=stu[j]; stu[j]=stu[j+1]; stu[j+1]=temp; } } }

sort_type=2; break; }

case 3: {

for(i=0;i

for(j=0;j

if(stu[j].score[1]

temp=stu[j]; stu[j]=stu[j+1]; stu[j+1]=temp; } } }

sort_type=3; break; }

case 4: {

for(i=0;i