C语言的学生选课系统~大家帮帮忙啊~

C语言的学生选课系统~大家帮帮忙啊~,第1张

#include<iostream.h>

#include<string.h>

#include<iomanip.h>

#include<conio.h>

#include<iostream>

struct student //定义一个学生结构体

{ char name[8]

int num

char bj[20]

int GS,YY,JSJ,SUM}

int s=0

class student1 //定义一个学生类

{ private: student stu[40]

char name,bj

int numint GS,YY,JSJ,SUM

public:

void sr(char *,int,char *,int,int,int)

void print(int)

int jc(int xxh) { int m=0

while(m<=s+1)

if(xxh==stu[m++].num) break

if(m>s+1) return 0

else

return 1}

void cz(int)

void sc(int)

void sum(int)}

void student1::sr(char *xm,int xh,char *dz,int gs,int yy,int jsj) //输入模块

{ strcpy(stu[s].name,xm)

stu[s].num=xhstrcpy(stu[s].bj,dz)stu[s].GS=gs

stu[s].YY=yy

stu[s].JSJ=jsj}

void student1::print(int s) //输出模块

{ cout<<s<<"\t"

cout<<stu[s].name<<"\t"

cout<<stu[s].num<<"\t"

cout<<stu[s].bj<<"\t"

cout<<stu[s].GS<<"\t"

cout<<stu[s].YY<<"\t"

cout<<stu[s].JSJ<<"\t"cout<<endl}

void student1::cz(int s) //查找模块

{ int xxh,p

while(s==0)

{ cout<<"没有记录,请先输入记录!"<<endl

break}

if(s!=0)

{cout<<"请输入您要查找的学号:"

cin>>xxh

while (xxh<100000||xxh>999999) //判断输入的学号是否正确

{ cout<<"您输入的学号不正确,请输入一个六位数的学号"<<endl

cin>>xxh} while(s!=0) //查找是否有符合条件的记录

{ p=1

if (xxh==stu[s].num)

{ cout<<"姓名\t学号\t班级\t高数\t英语\t计算机"<<endl

cout<<stu[s].name<<"\t"

cout<<stu[s].num<<"\t"

cout<<stu[s].bj<<"\t"

cout<<stu[s].GS<<"\t"

cout<<stu[s].YY<<"\t"

cout<<stu[s].JSJ<<endl

getch()break}

else

p=0s--} if(p==0)

cout<<"很抱歉,没有找到您要查找的学号!"<<endl}

getch()}

void student1::sc(int n) //删除模块

{ int xxh,p

char da

while(s==0)

{ cout<<"没有记录,请先输入记录!"<<endlbreak}

if(s!=0)

{ cout<<"请输入您要删除的学号:"

cin>>xxh

while (xxh<100000||xxh>999999)

{ cout<<"您输入的学号不正确,请您输入一个六位数的学号" <<endl

cin>>xxh}

for(int i=1i<=ni++)

{ if(stu[i].num!=xxh) p=0

if(stu[i].num==xxh)

{ cout<<"姓名\t学号\t班级\t高数\t英语\t计算机"<<endl

cout<<stu[i].name<<"\t"

cout<<stu[i].num<<"\t"

cout<<stu[i].bj<<"\t"

cout<<stu[i].GS<<"\t"

cout<<stu[i].YY<<"\t"

cout<<stu[i].JSJ<<endl

cout<<"您确实要删除该学生的记录吗?(y/n)"

cin>>da

if(da=='y'||da=='Y')

{ for(int j=ij<=n-1j++) //删除记录

{ strcpy(stu[j].name,stu[j+1].name)

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

strcpy(stu[j].bj,stu[j+1].bj)

stu[j].GS=stu[j+1].GS

stu[j].YY=stu[j+1].YY

stu[j].JSJ=stu[j+1].JSJ}

cout<<"该记录已删除!"<<endls=s-1p=1break}

else

{ cout<<"该记录未删除!"<<endl

p=1} } }

if(p==0) cout<<"很抱歉,没有找到您要找的学号!"<<endl}

getch()}

void student1::sum(int s) //排序模块

{ int chang

int b[40]

while(s==0)

{ cout<<"没有记录,请先输入记录!"<<endlbreak

} if(s!=0)

{ cout<<"姓名\t学号\t班级\t英语\t"

cout<<"高数\t计算机\t总分"<<endl

for(int k=1k<=sk++)

{ b[k]=stu[k].GS+stu[k].YY+stu[k].JSJ

stu[k].SUM=stu[k].GS+stu[k].YY+stu[k].JSJ

} for(int i=1i<=si++) //利用冒泡法对B[]进行排序

for(int j=1j<=s-ij++)

if(b[j]<b[j+1])

{ chang=b[j]

b[j]=b[j+1]

b[j+1]=chang}

for(int h=1h<=sh++) //输出与B[]中相同总分所对应的内容

for(int e=1e<=se++)

if(b[h]==stu[e].SUM)

{ cout<<stu[e].name<<"\t"

cout<<stu[e].num<<"\t"

cout<<stu[e].bj<<"\t"

cout<<stu[e].YY<<"\t"

cout<<stu[e].GS<<"\t"

cout<<stu[e].JSJ<<"\t"

cout<<stu[e].SUM<<endl} }

getch()

} void main()

{ student1 st

char da,a

char *xm,*dz

int gs,yy,jsj,xh

time_t t

while(1)

{ system("cls")

cout<<endl

cout<<" 学生信息管理"<<endl

cout<<"1.添加学生资料"<<' '

cout<<"2.显示学生资料"<<' '

cout<<"3.查找"<<' '

cout<<"4.删除"<<' '

cout<<"5.按总分进行排序"<<endl

cout<<"6.退出"<<endl

cout<<"请选择 *** 作(1-6)"<<endl

cin>>a

t: if(a=='6') break

switch (a)

{ case '1':

{ cout<<"请依次输入学生的姓名,学号,班级,高数,英语,计算机:"<<endl

xm=new char[]dz=new char[]cin>>xm>>xh>>dz>>gs>>yy>>jsj

while(st.jc(xh)) //调用JC模块判断学号是否重复

{ cout<<"学号重复,请重新输入!"<<endl

cin>>xh}

s=s+1

st.sr(xm,xh,dz,gs,yy,jsj)

cout<<"是否继续输入?(y/n)"

cin>>da

while (da=='y'||da=='Y') //判断是否要继续输入

{ cout<<"请依次输入学生的姓名,学号,班级,高数,英语,计算机:"<<endl

xm=new char[]dz=new char[]

cin>>xm>>xh>>dz>>gs>>yy>>jsj

while(st.jc(xh))

{ cout<<"学号重复,请重新输入!"<<endl

cin>>xh}

s=s+1

st.sr(xm,xh,dz,gs,yy,jsj)

cout<<"是否继续输入?(y/n)"

cin>>da}

getch()

}break

case '2':

{ if(s==0) //判断是否有记录输入

{ cout<<"没有记录,请先输入记录!"<<endlgetch()break}

if(s!=0)

{ cout<<"序号"<<"\t"cout<<"姓名"<<"\t"cout<<"学号"<<"\t"

cout<<"班级"<<"\t"

cout<<"高数"<<"\t"

cout<<"英语"<<"\t"

cout<<"计算机"<<endl

for(int i=1i<=si++)

st.print(i)

getch()} }

break

case '3':st.cz(s)break

case '4':st.sc(s)

break

case '5':st.sum(s)breakdefault:

{ while(a=='0'||a>'6') //判断选项是否正确

{ cout<<"错误选项,请重新选择!"<<endl

cin>>a} goto t}break} }

cout<<"谢谢您的使用!"<<endl}

另一个

#include<iostream.h>

#include<string.h>

class worker//社会保障对象的个人信息类

{

public:

worker()

~worker()

void enter()//保障对象信息录入构造函数

void display()//保障对象信息输出构造函数

void setsno(int temp)

int getsno()

char *getname()

long getgongzi()

void change()//保障对象信息修改构造函数

void read()

void write()

private:

int maxnum//保障对象编号最大值

int sno// 编号

char name[5]//姓名

char sex[2]//性别

int age//年龄

char birth[10]//出生日期

char folk[2]//民族

char mianmao[10]//政治面貌

char department[50]//个人及家庭情况

long gongzi//福利保障金额

char telephone[10]//联系电话

char address[30]//详细家庭住址

}

#include<iostream.h>

#include<iomanip.h>

#include<string.h>

#include<fstream.h>

#include<stdio.h>

worker::worker()

{}

worker::~worker()

{}

int worker::getsno()

{return sno}

long worker::getgongzi()

{return gongzi}

char *worker::getname()

{

return name}

void worker::setsno(int temp)

{sno=temp}

void worker::enter()

{

ifstream tfile("max.txt",ios::binary|ios::nocreate)

if(tfile)

{

tfile.read((char *)&maxnum,sizeof maxnum)

}

else

{

maxnum=100//编号初始化

}

tfile.close()

sno=maxnum++

ofstream ofile("max.txt")

ofile.write((char*)&maxnum,sizeof maxnum)

tfile.close()

cout<<"请输入人员信息"<<endl

cout<<"姓名:"<<endl

cin>>name

cout<<"性别(男(a),女(b)):"<<endl

cin>>sex

while(strcmp(sex,"a")!=0&&strcmp(sex,"b")!=0)

{ cout<<"错误请重新输入!"<<endl

cin>>sex

}

cout<<"年龄:"<<endl

cin>>age

while(age<=15||age>=100)

{

cout<<"错误请重新输入!"<<endl

cin>>age

}

cout<<"出生日期:"<<endl

cin>>birth

cout<<"政治面貌(团员<t>,预备党员<y>,党员<d>):"<<endl

cin>>mianmao

while(strcmp(mianmao,"t")!=0&&strcmp(mianmao,"y")!=0&&strcmp(mianmao,"d")!=0)

{

cout<<"错误请重新输入!"<<endl

cin>>mianmao

}

cout<<"民族:"<<endl

cin>>folk

cout<<"个人及家庭情况:"<<endl

cin>>department

cout<<"福利保障金额:"<<endl

cin>>gongzi

cout<<"联系电话:"<<endl

cin>>telephone

cout<<"家庭住址:"<<endl

cin>>address

}

void worker::display()

{

cout<<setw(4)<<sno<<setw(8)<<name<<setw(5)<<

sex<<setw(6)<<age<<setw(6)<<folk<<setw(12)<<birth<<setw(8)<<

mianmao<<setw(10)<<department<<setw(10)<<gongzi<<setw(10)<<telephone<<setw(10)<<endl

cout<<address<<endl

}

void worker::change()

{

cout<<"请输入要修改人员的信息:"<<endl

cout<<"姓名是不是要改写(Y/N)"<<endl

char ch

cin>>ch

if(ch=='Y'||ch=='y')

{

cout<<"请输入新姓名:"<<endl

cin>>name

}

cout<<"性别(男(a),女(b)):"<<endl

cin>>sex

cout<<"年龄:"<<endl

cin>>age

while(age<=15||age>=50)

{

cout<<"错误请重新输入!"<<endl

cin>>age

}

cout<<"出生日期:"<<endl

cin>>birth

cout<<"民族:"<<endl

cin>>folk

cout<<"政治面貌(t,y,d):"<<endl

cin>>mianmao

while(strcmp(mianmao,"t")!=0&&strcmp(mianmao,"y")!=0&&strcmp(mianmao,"d")!=0)

{

cout<<"错误请重新输入!"<<endl

cin>>mianmao

}

cout<<"个人及家庭情况:"<<endl

cin>>department

cout<<"福利保障金额:"<<endl

cin>>gongzi

cout<<"联系电话:"<<endl

cin>>telephone

cout<<"家庭住址:"<<endl

cin>>address

cout<<"你刚刚输入的信息如下:"<<endl

display()

}

#include<iostream.h>

#include<fstream.h>

#include<string.h>

#include<iomanip.h>

#include<stdlib.h>

worker information//worker 类的全局变量

void menu()

{ cout<<"********欢迎使用社会福利保障系统********"<<endl

cout<<"姓名:姜黎黎 编号:2005022055 "<<endl

cout<<"*******************************************************"<<endl

cout<<"*****构造和谐社会*****共建美好家园*****"<<endl

cout<<"*******************************************************"<<endl

cout<<" "<<endl

cout<<" 0.退出系统 "<<endl

cout<<" "<<endl

cout<<" 1.人员信息录入 "<<endl

cout<<" "<<endl

cout<<" 2.人员信息查询 "<<endl

cout<<" "<<endl

cout<<" "<<endl

cout<<" 3.人员信息输出 "<<endl

cout<<" "<<endl

cout<<" 请选择 *** 作(0======3) "<<endl

cout<<" "<<endl

cout<<" 保障对象编号初始值为:100(自动顺次加1) "<<endl

}

void read()

{

ifstream afile("worker.txt",ios::nocreate)

afile.read((char*)&information,sizeof information)

}

void write()

{

ofstream bfile("worker.txt",ios::app)

bfile.write((char*)&information,sizeof information)

}

void input(void)

{

char ch

information.enter()

write()

cout<<"你还要输入下一位人员的信息吗(Y/N)!"<<endl

cin>>ch

if(ch=='Y'||ch=='y')

{

input()

}

}

void search()

{

cout<<"请输入你的查找类型:(1.编号 2.姓名 3.保障金额)"<<endl

int k,i,m=0

char j,ch1[5]

cin>>j

while((j!='1')&&(j!='2')&&(j!='3'))

{ cout<<"错误请重新选择!"<<endl

cin>>j

}

if(j=='1')

{

cout<<"请输入你要查找的人员编号:"<<endl

cin>>i

}

if(j=='2')

{

cout<<"请输入你要查找的人员姓名:"<<endl

cin>>ch1

}

if(j=='3')

{

cout<<"请输入你要查找人员的社会福利保障金额:"<<endl

cin>>k

}

ifstream dfile("worker.txt",ios::nocreate)

while (dfile.good())

{

dfile.read((char *) &information,sizeof information)

if(i==information.getsno()||strcmp(information.getname(),ch1)==0||k==information.getgongzi())

{cout<<"你所要查找的信息如下:"<<endl

cout<<setw(6)<<"编号"<<setw(6)<<"姓名"<<setw(6)<<"性别"<<setw(6)<<

"年龄"<<setw(6)<<"民族"<<setw(10)<<"出生日期"<<

setw(10)<<"政治面貌"<<setw(10)<<"情况介绍"<<setw(10)<<"保障金额"<<setw(10)

<<"联系电话"<<setw(10)<<endl

cout<<"家庭住址"<<endl

information.display()

i=0

k=0

m=1

return

}

}

if(m!=1)

cout<<"对不起,你所查找的信息不存在!"<<endl

}

void output()

{

int i=0

ifstream cfile("worker.txt",ios::nocreate)

while(cfile)

{

if( cfile.read((char *)&information,sizeof information))

{

information.display()

i++

}

}

if(i!=0)

cout<<"一共有"<<i<<"个人员信息"<<endl

else

cout<<"还没有输入此人信息"<<endl

}

void select()//选择菜单函数

{

int ch

do{

cin>>ch

switch(ch)

{

case 0:

exit(0)

menu()

break

case 1:

input()

menu()

break

case 2:

search()

menu()

break

case 3:

output()

menu()

break

default :

menu()

cout<<"输入无效请重新输入(0======== 3)"<<endl

break

}

}while(1)

}

void main()

{

menu()

select()

}

#include "stdio.h"

#include"stddef.h"

#include "stdlib.h"

#include "string.h"

#include "time.h"//获取当前时间来产生随机值

#define Max 100

static Count=0

typedef struct stu

{

int classNum//学生学号

int CScore//语文成绩

int EScore//英语成绩

int MScore//数学成绩

float average//平均成绩

char Name[30]// 学生姓名

char sex[2]//学生性别

}student

void printMain()

{

printf("*****************************************\n")

printf("\t 欢迎使用学生管理系统!\n")

printf(" 作者:******\n")

printf("*****************************************\n")

printf("\t\t1:成绩录入!\n")

printf("\t\t2:成绩统计!\n")

printf("\t\t3:成绩查询!\n")

printf("\t\t4:成绩排序!\n")

printf("\t\t5:成绩插入!\n")

printf("\t\t6:成绩删除!\n")

printf("\t\t7:成绩修改!\n")

printf("\t\t8:成绩显示!\n")

printf("\t\t9:退出系统!\n")

printf("*****************************************\n")

printf("\n")

printf("请输入您的选择:")

}

void CinScore(student stu[])//输入学生信息

{

FILE *fp

printf("请输入学生的姓名:")

scanf("%s",&stu[Count].Name)

printf("\n请输入学生的性别(M or F):")

scanf("%s",&stu[Count].sex)

printf("\n请输入学生的学号:")

scanf("%d",&stu[Count].classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&stu[Count].CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&stu[Count].EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&stu[Count].MScore)

stu[Count].average=(stu[Count].CScore+

stu[Count].EScore+stu[Count].MScore)/3.0f

if(Count==0)

{

fp=fopen("40702.dat","w")

}

else

{

fp=fopen("40702.dat","ab")

}

fprintf(fp,"%s\n",stu[Count].Name)

fprintf(fp,"%s\n",stu[Count].sex)

fprintf(fp,"%d\n",stu[Count].classNum)

fprintf(fp,"%d\n",stu[Count].CScore)

fprintf(fp,"%d\n",stu[Count].EScore)

fprintf(fp,"%d\n",stu[Count].MScore)

fprintf(fp,"%f\n",stu[Count].average)

fclose(fp)

Count++

}

void CinFile(student stu[])//从文件读入

{

FILE *fp1,*fp2

fp1=fopen("student.txt","r")

while(!feof(fp1))//判断文件读入是否结束

{

fscanf(fp1,"%s",&stu[Count].Name)

fscanf(fp1,"%s",&stu[Count].sex)

fscanf(fp1,"%d",&stu[Count].classNum)

fscanf(fp1,"%d",&stu[Count].CScore)

fscanf(fp1,"%d",&stu[Count].EScore)

fscanf(fp1,"%d",&stu[Count].MScore)

fscanf(fp1,"%f",&stu[Count].average)

if(Count==0)

{

fp2=fopen("40702.dat","w")

}

else

{

fp2=fopen("40702.dat","ab")

}

fprintf(fp2,"%s\n",stu[Count].Name)

fprintf(fp2,"%s\n",stu[Count].sex)

fprintf(fp2,"%d\n",stu[Count].classNum)

fprintf(fp2,"%d\n",stu[Count].CScore)

fprintf(fp2,"%d\n",stu[Count].EScore)

fprintf(fp2,"%d\n",stu[Count].MScore)

fprintf(fp2,"%f\n",stu[Count].average)

fclose(fp2)

Count++

}

Count--

fclose(fp1)

}

void InputScore(student stu[])

{

int choice

printf("1:从文件读入!\n")

printf("2:手动输入!\n")

printf("请输入您的选择:")

scanf("%d",&choice)

switch(choice)

{

case 1:

CinFile(stu)

break

case 2:

CinScore(stu)

break

default:

printf("您的输入有误!\n")

break

}

}

void ClassifyScore(student stu[])//统计各分数段的人数

{

int perfect=0//记录优秀的人数

int good=0//记录良好的人数

int medium=0//记录中等的人数

int pass=0//记录及格的人数

int bad=0//记录不及格的人数

int i=0

for(i=0i<Counti++)

{

if(stu[i].average<60)

{

bad++

}

else if(stu[i].average<70)

{

pass++

}

else if(stu[i].average<80)

{

medium++

}

else if(stu[i].average<90)

{

good++

}

else if(stu[i].average<=100)

{

perfect++

}

}

printf("成绩为优秀的人数为 :\t%d\n",perfect)

printf("成绩为良好的人数为 :\t%d\n",good)

printf("成绩为中等的人数为 :\t%d\n",medium)

printf("成绩为及格的人数为 :\t%d\n",pass)

printf("成绩为不及格的数为 :\t%d\n",bad)

}

void SearchName(student stu[])//按名字查询

{

int i

char tempname[30]

printf("请输入要查询的姓名: ")

scanf("%s",&tempname)

printf("\n")

for(i=0i<Counti++)

{

if(strcmp(tempname,stu[i].Name)==0)

{

printf("姓名\t性别\t语文成绩 英语成绩 数学成绩 平均成绩\n")

printf("\n%s \t%s \t%d \t %d \t %d \t%.3f\n",stu[i].Name,

stu[i].sex,stu[i].CScore,stu[i].EScore,stu[i].MScore,

stu[i].average)

break

}

}

if(strcmp(tempname,stu[i].Name))

{

printf("没有这个学生的信息!\n")

}

}

void SearchClass(student stu[])//按学号查询

{

int i

int tempClass

printf("请输入要查询的学号: ")

scanf("%d",&tempClass)

printf("\n")

for(i=0i<Counti++)

{

if(tempClass==stu[i].classNum)

{

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

printf("\n%s \t%s \t%d\t%d \t %d \t %d \t%.3f\n",stu[i].Name,

stu[i].sex,stu[i].classNum,stu[i].CScore,stu[i].EScore,stu[i].MScore,

stu[i].average)

break

}

}

if(stu[i].classNum!=tempClass)

{

printf("没有这个学生的信息!\n")

}

}

void SearchStu(student stu[])//成绩查询

{

printf("1:按姓名查找!\n")

printf("2:按学号查找!\n")

int choice

printf("请输入您的选择: ")

scanf("%d",&choice)

printf("\n")

switch(choice)

{

case 1:

SearchName(stu)

break

case 2:

SearchClass(stu)

break

default:

printf("您的输入有误!")

system("cls")

break

}

}

void Equal(student *p,student *q)//把右边的结构体的值赋给左边

{

p->average=q->average

p->classNum=q->classNum

p->CScore=q->CScore

p->EScore=q->EScore

p->MScore=q->MScore

strcpy(p->Name,q->Name)

strcpy(p->sex,q->sex)

}

void Writefile(FILE *fp,student stu[])//写入文件并输出到屏幕

{

int i=0

for(i=0i<Counti++)

{

printf("\n%s \t%s \t%d\t%d \t %d \t %d \t%.3f\n",stu[i].Name,

stu[i].sex,stu[i].classNum,stu[i].CScore,stu[i].EScore,stu[i].MScore,

stu[i].average)

fprintf(fp,"%s\n",stu[i].Name)

fprintf(fp,"%s\n",stu[i].sex)

fprintf(fp,"%d\n",stu[i].classNum)

fprintf(fp,"%d\n",stu[i].CScore)

fprintf(fp,"%d\n",stu[i].EScore)

fprintf(fp,"%d\n",stu[i].MScore)

fprintf(fp,"%f\n",stu[i].average)

}

fclose(fp)

}

void WritefileOnly(FILE *fp,student stu[])//只写入文件

{

int i=0

for(i=0i<Counti++)

{

fprintf(fp,"%s\n",stu[i].Name)

fprintf(fp,"%s\n",stu[i].sex)

fprintf(fp,"%d\n",stu[i].classNum)

fprintf(fp,"%d\n",stu[i].CScore)

fprintf(fp,"%d\n",stu[i].EScore)

fprintf(fp,"%d\n",stu[i].MScore)

fprintf(fp,"%f\n",stu[i].average)

}

fclose(fp)

}

void swapScore(student *p,student *q)

{

student *temp

temp=(student*)malloc(sizeof(student))

temp->average=p->average

temp->classNum=p->classNum

temp->CScore=p->CScore

temp->EScore=p->EScore

temp->MScore=p->MScore

strcpy(temp->Name,p->Name)

strcpy(temp->sex,p->sex)

p->average=q->average

p->classNum=q->classNum

p->CScore=q->CScore

p->EScore=q->EScore

p->MScore=q->MScore

strcpy(p->Name,q->Name)

strcpy(p->sex,q->sex)

q->average=temp->average

q->classNum=temp->classNum

q->CScore=temp->CScore

q->EScore=temp->EScore

q->MScore=temp->MScore

strcpy(q->Name,temp->Name)

strcpy(q->sex,temp->sex)

free(temp)

}

void sortChinese(student stu[])

{

FILE *fp

int i,j

student *p

p=stu

for(i=0i<Count-1i++)

{

for(j=0j<Count-ij++)

{

if(stu[j+1].CScore>stu[j].CScore)

{

swapScore((p+j),(p+j+1))

}

}

}

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

fp=fopen("40702.dat","w")

Writefile(fp,stu)

}

void sortMath(student stu[])

{

FILE *fp

int i,j

student *p

p=stu

for(i=0i<Count-1i++)

{

for(j=0j<Count-ij++)

{

if(stu[j+1].MScore>stu[j].MScore)

{

swapScore((p+j),(p+j+1))

}

}

}

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

fp=fopen("40702.txt","w")

Writefile(fp,stu)

}

void sortEnglish(student stu[])

{

FILE *fp

int i,j

student *p

p=stu

for(i=0i<Count-1i++)

{

for(j=0j<Count-ij++)

{

if(stu[j+1].EScore>stu[j].EScore)

{

swapScore((p+j),(p+j+1))

}

}

}

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

fp=fopen("40702.dat","w")

Writefile(fp,stu)

}

void sortCourse(student stu[])//按单科成绩排序

{

int choice

printf("1:按语文成绩排序!\n")

printf("2:按数学成绩排序!\n")

printf("3:按英语成绩排序!\n")

printf("请输入您的选择:\n")

scanf("%d",&choice)

switch(choice)

{

case 1:

sortChinese(stu)

break

case 2:

sortMath(stu)

break

case 3:

sortEnglish(stu)

break

default:

printf("输入有误!\n")

system("PAUSE")

break

}

}

void sortAverage(student stu[])//本函数使用平均成绩来进行排序

{

FILE *fp

int i,j

student *p

p=stu

for(i=0i<Count-1i++)

{

for(j=0j<Count-ij++)

{

if(stu[j+1].average>stu[j].average)

{

swapScore((p+j),(p+j+1))

}

}

}

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

fp=fopen("40702.dat","w")

Writefile(fp,stu)

}

void sortScore(student stu[])

{

int choice

printf("1:按平均成绩排序!\n")

printf("2:按单科成绩排序!\n")

printf("请输入您的选择:\n")

scanf("%d",&choice)

switch(choice)

{

case 1:

sortAverage(stu)

break

case 2:

sortCourse(stu)

break

default:

printf("输入有误!\n")

system("PAUSE")

break

}

}

void insertName(student stu[])//按名字插入学生信息

{

char tempName[30]

student *p,*temp

student tempStu

temp=&tempStu

p=stu

int i,j

FILE *fp,*fp1

printf("\n输入插入处学生的姓名:")

scanf("%s",&tempName)

for(i=0i<Counti++)

{

if(strcmp(stu[i].Name,tempName)==0)

{

break

}

}

if(strcmp(stu[i].Name,tempName))

{

printf("插入有错,没有此学生!\n")

return

}

printf("请输入要插入的学生的信息!\n")

printf("请输入学生姓名:")

scanf("%s",&tempStu.Name)

printf("\n请输入学生性别:")

scanf("%s",&tempStu.sex)

printf("\n请输入学生学号:")

scanf("%d",&tempStu.classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&tempStu.CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&tempStu.EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&tempStu.MScore)

tempStu.average=(tempStu.CScore+

tempStu.EScore+tempStu.MScore)/3.0f

Count++

for(j=Count-1j>i+1j--)

{

Equal(p+j,p+j-1)

}

Equal((p+i+1),temp)

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

fclose(fp)

fp1=fopen("student.txt","w")

WritefileOnly(fp1,stu)

fclose(fp1)

}

void insertNumber(student stu[])//按学号插入学生信息

{

int tempNumber

student *p,*temp

p=stu

student tempStu

temp=&tempStu

int i,j

FILE *fp,*fp1

printf("\n输入插入处学生的学号:")

scanf("%d",&tempNumber)

for(i=0i<Counti++)

{

if(stu[i].classNum==tempNumber)

{

break

}

}

if(stu[i].classNum!=tempNumber)

{

printf("插入有错,没有此学生!\n")

return

}

printf("请输入要插入的学生的信息!\n")

printf("请输入学生姓名:")

scanf("%s",&tempStu.Name)

printf("\n请输入学生性别:")

scanf("%s",&tempStu.sex)

printf("\n请输入学生学号:")

scanf("%d",&tempStu.classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&tempStu.CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&tempStu.EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&tempStu.MScore)

tempStu.average=(tempStu.CScore+

tempStu.EScore+tempStu.MScore)/3.0f

Count++

for(j=Count-1j>i+1j--)

{

Equal((p+j),(p+j-1))

}

Equal((p+i+1),temp)

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

fclose(fp)

fp1=fopen("student.txt","w")

WritefileOnly(fp1,stu)

fclose(fp1)

}

void insertRandom(student stu[])

{

FILE *fp,*fp1

student *p,*temp

p=stu

student tempStu

temp=&tempStu

int j

srand(time(0))

int randNumber=rand()%Count

printf("请输入要插入的学生的信息!\n")

printf("请输入学生姓名:")

scanf("%s",&tempStu.Name)

printf("\n请输入学生性别:")

scanf("%s",&tempStu.sex)

printf("\n请输入学生学号:")

scanf("%d",&tempStu.classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&tempStu.CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&tempStu.EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&tempStu.MScore)

tempStu.average=(tempStu.CScore+

tempStu.EScore+tempStu.MScore)/3.0f

Count++

for(j=Count-1j>randNumberj--)

{

Equal((p+j),(p+j-1))

}

Equal((p+randNumber),temp)

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

fclose(fp)

fp1=fopen("student.txt","w")

WritefileOnly(fp1,stu)

fclose(fp1)

}

void insertStu(student stu[])//插入学生信息

{

int choice

if(Count==0)

{

printf("没有学生信息!\n")

CinScore(stu)

return

}

printf("1:按姓名插入!\n")

printf("2:按学号插入!\n")

printf("3:随机插入!\n")

printf("请输入您的选择:")

scanf("%d",&choice)

switch(choice)

{

case 1:

insertName(stu)

break

case 2:

insertNumber(stu)

break

case 3:

insertRandom(stu)

break

default:

printf("您的输入有误!")

system("PAUSE")

break

}

}

void DeleteName(student stu[])

{

int i,j

FILE *fp

char tempName[30]

student *p=stu

printf("请输入要删除的学生的姓名:")

scanf("%s",tempName)

for(i=0i<Counti++)

{

if(strcmp(stu[i].Name,tempName)==0)

{

break

}

}

if(strcmp(stu[i].Name,tempName))

{

printf("对不起,没有这个学生,这个学生可能已经被删除!\n")

system("PAUSE")

}

for(j=ij<Count-1j++)

{

Equal((p+j),(p+j+1))

}

Count--

fp=fopen("40702.dat","w")

printf(" *** 作成功!\n")

WritefileOnly(fp,stu)

}

void DeleteNumber(student stu[])

{

int i,j

int tempNumber=0

FILE *fp

student *p

p=stu

printf("请输入要删除的学生的学号:")

scanf("%d",&tempNumber)

for(i=0i<Counti++)

{

if(stu[i].classNum==tempNumber)

{

break

}

}

if(stu[i].classNum!=tempNumber)

{

printf("对不起,没有这个学生,这个学生可能已经被删除!\n")

system("PAUSE")

}

for(j=ij<Count-1j++)

{

Equal((p+j),(p+j+1))

}

Count--

fp=fopen("40702.dat","w")

printf(" *** 作成功!\n")

WritefileOnly(fp,stu)

}

void DeleteScore(student stu[])//删除学生信息

{

int choice

printf("1:按姓名删除!\n")

printf("2:按学号删除!\n")

printf("请输入您的选择:")

scanf("%d",&choice)

switch(choice)

{

case 1:

DeleteName(stu)

break

case 2:

DeleteNumber(stu)

break

default:

printf("您的输入有误!")

system("PAUSE")

break

}

}

void ChangeName(student stu[])

{

int i

FILE *fp

char tempName[30]

student *p=stu

printf("请输入要修改的学生的姓名:")

scanf("%s",&tempName)

for(i=0i<Counti++)

{

if(strcmp(stu[i].Name,tempName)==0)

{

break

}

}

if(strcmp(stu[i].Name,tempName))

{

printf("对不起,没有这个学生的信息!\n")

}

else

{

printf("请输入学生的姓名:")

scanf("%s",&stu[i].Name)

printf("\n请输入学生的性别(M or F):")

scanf("%s",&stu[i].sex)

printf("\n请输入学生的学号:")

scanf("%d",&stu[i].classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&stu[i].CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&stu[i].EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&stu[i].MScore)

stu[i].average=(stu[i].CScore+

stu[i].EScore+stu[i].MScore)/3.0f

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

}

}

void ChangeNumber(student stu[])

{

int i

FILE *fp

int tempNumber=0

student *p=stu

printf("请输入要修改的学生的学号:")

scanf("%d",&tempNumber)

for(i=0i<Counti++)

{

if(stu[i].classNum==tempNumber)

{

break

}

}

if(stu[i].classNum!=tempNumber)

{

printf("对不起,没有这个学生的信息!\n")

}

else

{

printf("请输入学生的姓名:")

scanf("%s",&stu[i].Name)

printf("\n请输入学生的性别(M or F):")

scanf("%s",&stu[i].sex)

printf("\n请输入学生的学号:")

scanf("%d",&stu[i].classNum)

printf("\n请输入学生的语文成绩:")

scanf("%d,",&stu[i].CScore)

printf("\n请输入学生的英语成绩:")

scanf("%d",&stu[i].EScore)

printf("\n请输入学生的数学成绩:")

scanf("%d",&stu[i].MScore)

stu[i].average=(stu[i].CScore+

stu[i].EScore+stu[i].MScore)/3.0f

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

}

}

void ChangeScore(student stu[])//改变学生信息

{

int choice

printf("1:按学生姓名修改!\n")

printf("2:按学生学号修改!\n")

printf("请输入您的选择:")

scanf("%d",&choice)

switch(choice)

{

case 1:

ChangeName(stu)

break

case 2:

ChangeNumber(stu)

break

default:

printf("您的输入有误!\n")

system("PAUSE")

break

}

}

void printScore(student stu[])//显示学生信息

{

FILE *fp

int i=0

if(Count==0)

{

printf("没有学生信息!请添加学生信息!\n")

return

}

else

{

printf("姓名\t性别\t学号\t语文成绩 英语成绩 数学成绩 平均成绩\n")

for(i=0i<Counti++)

{

printf("\n%s \t%s \t%d\t%d \t %d \t %d \t%.3f\n",stu[i].Name,

stu[i].sex,stu[i].classNum,stu[i].CScore,stu[i].EScore,stu[i].MScore,

stu[i].average)

}

}

fp=fopen("40702.dat","w")

WritefileOnly(fp,stu)

fclose(fp)

}

int main()//主函数

{

student stu[Max]

char goon='y'

int choice

while(goon!='n')

{

printMain()

scanf("%d",&choice)

switch(choice)

{

case 1:

InputScore(stu)

break

case 2:

ClassifyScore(stu)

break

case 3:

SearchStu(stu)

break

case 4:

sortScore(stu)

break

case 5:

insertStu(stu)

break

case 6:

DeleteScore(stu)

break

case 7:

ChangeScore(stu)

break

case 8:

printScore(stu)

break

case 9:

exit(0)

break

default:

printf("输入有误!\n")

break

}

printf("是否继续(输入n结束)?\n")

scanf("%s",&goon)

system("cls")

}

return 0

}

/*你把所有标记为“选题”的内容改为“选课”即可,用的不是链表,是随机文件*/

#include <conio.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <time.h>

#define szSTR 256

#define szNAME 10

#define szGROUP 5 /*每个小组最多允许5名组员,包括组长*/

#define fileAssignments "c:\\0.txt"

#define fileProjects "c:\\1.txt"

#define cntTYPE 4

/*题目*/

char Types[cntTYPE][11] = {"数据结构类", "趣味类", "管理类", "自选类"}

struct TAssignment {

int number/*题目编号*/

int level/*难度系数*/

int type/*类别*/

char title[szSTR]

char requirements[szSTR]/*技术要求*/

char features[szSTR]/*技术特点*/

}

time_t Date_Input(char * msg)

{

struct tm tmemset(&t, 0, sizeof(t))

printf("请输入%s日期,格式为年/月/日:", msg)

scanf("%d/%d/%d", &(t.tm_year), &(t.tm_mon), &(t.tm_mday))

t.tm_year -= 1900

t.tm_mon --

return mktime(&t)

}

void Date_Print(time_t t)

{

struct tm * ft = localtime(&t)

printf("%04d/%02d/%02d", ft->tm_year + 1900, ft->tm_mon + 1, ft->tm_mday)

}

void Number_Input(char * msg, int * x)

{

for() {

printf("请输入%s,以回车结束:", msg)

scanf("%d", x)

if(*x <0) *x = -*x

if(*x) break

printf("错误的输入,请重新输入。\n")

}

}

void String_Input(char * msg, char * str)

{

printf("请输入%s,以回车结束:", msg)

fflush(stdin)

fgets(str, szSTR, stdin)

}

int Type_Input(void)

{

int t = 0, i = 0

for() {

printf("请输入题目类别:")

for(i = 0i <cntTYPEi++) printf("%d - %s\t", i, Types[i])

printf("\b\n")

t = getch() - '0'

if(t >= 0 &&t <= cntTYPE) break

printf("错误的输入\n")

}

return t

}

fpos_t ASSG_Query(int number)

{

FILE * f = 0fpos_t p = 0

struct TAssignment a

if(number <1) return 0

f = fopen(fileAssignments, "rb")

if(!f) {

fprintf(stderr, "题目文件无法打开\n")

return 0

}

while(!feof(f)) {

fgetpos(f, &p)

fread(&a, sizeof(a), 1, f)

if(a.number == number) {

fclose(f)

return p + 1

}

}

fclose(f)

return 0

}

void ASSG_Append(void)

{

FILE * f = 0fpos_t p = 0

struct TAssignment a

memset(&a, 0, sizeof(a))

Number_Input("题目编号", &(a.number ))

p = ASSG_Query(a.number )

if(p) {

fprintf(stderr, "该题目已存在。\n")

return

}

Number_Input("难度系数", &(a.level))

String_Input("题目名称", a.title )

a.type = Type_Input()

String_Input("技术要求", a.requirements)

String_Input("技术特点", a.features)

f = fopen(fileAssignments, "ab")

if(!f) {

fprintf(stderr, "题目文件无法打开\n")

return

}

fwrite(&a, sizeof(a), 1, f)

fclose(f)

}

void ASSG_Delete(void)

{

fpos_t p = 0FILE * f = 0

struct TAssignment a

Number_Input("题目编号", &(a.number ))

p = ASSG_Query(a.number )

if(p == 0) {

fprintf(stderr, "该题目不存在。\n")

return

}

p--

f = fopen(fileAssignments, "rb+")

if(!f) {

fprintf(stderr, "题目文件无法打开!\n")

return

}

fsetpos(f, &p)

memset(&a, 0, sizeof(a))

fwrite(&a, sizeof(a), 1, f)

fclose(f)

printf("删除成功!\n")

}

void PrintLine(void)

{

int i = 0for(i=0i<79i++) putchar('-')

putchar('\n')

}

void ASSG_Report(void)

{

FILE * f = 0struct TAssignment aint r = 0

f = fopen(fileAssignments, "rb")

if(!f) {

fprintf(stderr, "目前数据库中没有题目。\n")

return

}

printf("\n题目数据库\n")

while(!feof(f)) {

r = fread(&a, sizeof(a), 1, f)

if(r <1) break

if(a.number == 0) continue

PrintLine()

printf("【编号】%d\t【类别】%s\t【难度系数】%d\t【题目】%s【技术要求】%s【技术特点】%s",

a.number , Types[a.type ], a.level ,

a.title , a.requirements , a.features )

}

fclose(f)

printf("\n\n")

}

void ASSG_Brief(int number)

{

struct TAssignment aFILE * f = 0

fpos_t p = ASSG_Query(number)

if(!p) {

printf("【尚未选题】\n")

return

}

p--

f = fopen(fileAssignments, "rb")

fsetpos(f, &p)

fread(&a, sizeof(a), 1, f)

fclose(f)

printf("【题目编号】%d【类别】%s【难度系数】%d\t【题目】%s",

a.number , Types[a.type ], a.level ,a.title )

}

int ASSG_Choose(void)

{

int number = 0fpos_t p = 0

Number_Input("题目编号", &number)

p = ASSG_Query(number)

return p?number:0

}

void ASSG_Menu(void)

{

int cmd = 0

for() {

printf("*****题目管理*****\n0-查看\t1-新增\t2-删除题目\t任意键返回\n")

cmd = getch() - '0'

switch(cmd) {

case 0: ASSG_Report()break

case 1: ASSG_Append()break

case 2: ASSG_Delete()break

default: return

}

}

}

/*项目信息*/

struct TProject {

int group_number /*组号*/

char members[szGROUP][szNAME]/*小组成员,编号0为组长*/

int assignment/*选题*/

time_t date_open/*开题日期*/

time_t date_close/*结题日期*/

char teacher[szNAME]/*指导教师*/

int process/*进度0~100%*/

char jobs[szSTR]/*分工*/

int score/*评分*/

}

void PROJ_Report(void)

{

struct TProject pint r = 0

FILE * f = fopen(fileProjects, "rb")

if(!f) {

fprintf(stderr, "目前没有开放项目信息。\n")

return

}

printf("*****项目及小组信息*****\n")

while(!feof(f)) {

r = fread(&p, sizeof(p), 1, f)

if(r <1) break

if(p.group_number ==0) continue

PrintLine()

printf("【组号】%d\t【指导教师】%s【组长】%s\n",

p.group_number , p.teacher , p.members[0])

printf("【组员】%s %s %s %s\n", p.members[1], p.members[2], p.members[3], p.members[4])

printf("【分工】%s", p.jobs )

ASSG_Brief(p.assignment )

if(p.assignment ) {

printf("【开题日期】")Date_Print(p.date_open)

printf("【结题日期】")Date_Print(p.date_close)

printf("【进度】%d%%【评分】%d\n", p.process, p.score )

}

}

fclose(f)

PrintLine()

}

fpos_t PROJ_Query(int number)

{

struct TProject pfpos_t q = 0int r = 0

FILE * f = fopen(fileProjects, "rb")

if(!f) return 0

while(!feof(f)) {

fgetpos(f, &q)

r = fread(&p, sizeof(p), 1, f)

if(r <1) break

if(p.group_number == number) {

fclose(f)

return q+1

}

}

fclose(f)

return 0

}

void PROJ_Append(void)

{

struct TProject pfpos_t q = 0FILE * f = 0int i = 0

memset(&p, 0, sizeof(p))

Number_Input("项目小组编号", &(p.group_number))

q = PROJ_Query(p.group_number )

if(q) {

fprintf(stderr, "该小组已经存在。\n")

return

}

printf("请录入组员信息,第一个组员是组长:")

for(i = 0i<5i++) scanf("%s", p.members [i])

printf("请输入指导教师姓名:")scanf("%s", p.teacher )

String_Input("分工信息", p.jobs )

f = fopen(fileProjects, "ab")

fwrite(&p, sizeof(p), 1, f)

fclose(f)

printf("项目小组已创建,可以从菜单进行选题。\n")

}

void PROJ_Delete(void)

{

struct TProject pfpos_t q = 0FILE * f = 0

memset(&p, 0, sizeof(p))

Number_Input("项目小组编号", &(p.group_number))

q = PROJ_Query(p.group_number )

if(q == 0) {

fprintf(stderr, "没有关于该小组的信息。\n")

return

}

q--

f = fopen(fileProjects, "rb+")

fsetpos(f, &q)

memset(&p, 0, sizeof(p))

fwrite(&p, sizeof(p), 1, f)

fclose(f)

printf("该小组信息已删除!\n")

}

int PROJ_Invalid(int assignment)

{

struct TProject pint sum = 0int r = 0

FILE * f = fopen(fileProjects, "rb")

if(!f) return 1

while(!feof(f)) {

r = fread(&p, sizeof(p), 1, f)

if(r <1) break

if(p.group_number == 0) continue

if(p.assignment == assignment) sum++

}

fclose(f)

return sum<5?0:1

}

void PROJ_Select(void)

{

struct TProject pfpos_t q = 0FILE * f = 0time_t t = 0

memset(&p, 0, sizeof(p))

Number_Input("项目小组编号", &(p.group_number))

q = PROJ_Query(p.group_number )

if(q == 0) {

fprintf(stderr, "没有关于该小组的信息。\n")

return

}

q--

f = fopen(fileProjects, "rb")

fsetpos(f, &q)

memset(&p, 0, sizeof(p))

fread(&p, sizeof(p), 1, f)

fclose(f)

p.assignment = ASSG_Choose()

if(p.assignment==0) {

fprintf(stderr, "错误的题目编号。请在题库中查证后重新选题\n")

return

}

if(PROJ_Invalid(p.assignment)) {

fprintf(stderr, "已经有5个小组选择了该题目,请重新选题\n")

return

}

p.date_open = Date_Input("开题")

p.date_close= Date_Input("结题")

if(p.date_open >p.date_close) {

t = p.date_close

p.date_close = p.date_open

p.date_open = t

}

p.process = 0

f = fopen(fileProjects, "rb+")

fsetpos(f, &q)

fwrite(&p, sizeof(p), 1, f)

fclose(f)

}

void PROJ_Progress(void)

{

struct TProject pfpos_t q = 0FILE * f = 0

memset(&p, 0, sizeof(p))

Number_Input("项目小组编号", &(p.group_number))

q = PROJ_Query(p.group_number )

if(q == 0) {

fprintf(stderr, "没有关于该小组的信息。\n")

return

}

q--

f = fopen(fileProjects, "rb")

if(!f) {

fprintf(stderr, "数据库无记录!\n")

return

}

fsetpos(f, &q)

memset(&p, 0, sizeof(p))

fread(&p, sizeof(p), 1, f)

fclose(f)

if(p.assignment <1) {

fprintf(stderr, "尚未选题,请选题后再补登进度\n")

return

}

Number_Input("进度(0~100)", &(p.process ))

if(p.process <0 || p.process >100) {

fprintf(stderr, "错误的进度\n")

return

}

f = fopen(fileProjects, "rb+")

fsetpos(f, &q)

fwrite(&p, sizeof(p), 1, f)

fclose(f)

printf("进度已经登记完成!\n")

}

void PROJ_Evaluate(void)

{

struct TProject pfpos_t q = 0FILE * f = 0

memset(&p, 0, sizeof(p))

Number_Input("项目小组编号", &(p.group_number))

q = PROJ_Query(p.group_number )

if(q == 0) {

fprintf(stderr, "没有关于该小组的信息。\n")

return

}

q--

f = fopen(fileProjects, "rb")

fsetpos(f, &q)

memset(&p, 0, sizeof(p))

fread(&p, sizeof(p), 1, f)

fclose(f)

if(p.assignment <1) {

fprintf(stderr, "尚未选题,请选题后再进行评分\n")

return

}

Number_Input("评分(0~100)", &(p.score ))

if(p.score <0 || p.score >100) {

fprintf(stderr, "错误的评分\n")

return

}

f = fopen(fileProjects, "rb+")

fsetpos(f, &q)

fwrite(&p, sizeof(p), 1, f)

fclose(f)

printf("成绩已经评定完成!\n")

}

void PROJ_Menu(void)

{

int cmd = 0

for() {

printf("*****项目管理*****\n0-查看\t1-新增\t2-删除\t3-选题\t4-登记进度\t5-打分\t任意键返回\n")

cmd = getch() - '0'

switch(cmd) {

case 0: PROJ_Report()break

case 1: PROJ_Append()break

case 2: PROJ_Delete()break

case 3: PROJ_Select()break

case 4: PROJ_Progress()break

case 5: PROJ_Evaluate()break

default: return

}

}

}

int main(void)

{

int cmd = 0

for() {

printf("*****欢迎使用学生实践管理软件*****\n0-题目管理\n1-项目管理\n其他任意键退出\n")

cmd = getch() - '0'

switch(cmd) {

case 0: ASSG_Menu()break

case 1: PROJ_Menu()break

default: return 0

}

}

return 0

}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/6709194.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-03-27
下一篇2023-03-27

发表评论

登录后才能评论

评论列表(0条)

    保存