char sex[4];
char adds[15];
char phone[14];
char ];
float chinese,math,english,txhp,pinde,teacher;
int zcmc,ksmc;
double **e,zc;
struct student *next;
#define len sizeof(struct student)
int len; /链表长度。
int a=0,b=0,c=0,d=0,e=0;//用来存放成绩各阶的人数。
char stu[10];
struct student *read()
while(!feof(fp))
if(fread(p1,len,1,fp)!=1)
if(head==null)
head=p2=p1;else
fclose(fp);
return head;
void s**e(struct student *head)
while(p)
elsep=p->next;
cout<<"数据存入成功!请按任意键继续!" fclose(fp); /单次输入。 void sinput(struct student *p) cout<<"请输入学号:" cout<<"请输入姓名: "cin>>p->name; cout<<"请输入性别: "cin>>p->sex; cout<<"请输入家庭住址: "cin>>p->adds; cout<<"请输入联系**: "cin>>p->phone; cout<<"请输入qq: "cin>>p->qq; cout<<"请输入语文成绩:" if(p->chinese>100||p->chinese<0) cout<<"成绩输入不符合规定,请重新输入:" cout<<"请输入数学成绩:" if(p->math>100||p->math<0) cout<<"成绩输入不符合规定,请重新输入:" cout<<"请输入英语成绩:" if(p->english>100||p->english<0) cout<<"成绩输入不符合规定,请重新输入:" cout<<"请输入同学互评分:" if(p->txhp>100||p->txhp<0) cout<<"成绩输入不符合规定,请重新输入:" cout<<"请输入品德成绩:" if(p->pinde>100||p->pinde<0) cout<<"成绩输入不符合规定,请重新输入:" cout<<"请输入任课教师评分:" if(p->teacher>100||p->teacher<0) cout<<"成绩输入不符合规定,请重新输入:" p->**e=(p->chinese+p->math+p->english)/3.0; p->zc=(p->**e*0.6+p->txhp*0.1+p->pinde*0.2+p->teacher*0.1); cout " " "