// å¦çæ绩管ç ç³»ç»
#include "stdio.h"
#include "malloc.h"
#include "windows.h"
#include "string.h"
int A=0;
int cc;
struct student
{
int stu_id;
char name[20];
float English;
float computer;
float chinese;
float math;
float sum;
int ranking;
struct student *next;
};
struct stu
{
int stu_id1;
char name1[20];
float English1;
float computer1;
float chinese1;
float math1;
float sum1;
}h;
struct score
{
float average;
float h_score;
float l_score;
struct score *next1;
};
Main_Interface();// 主çé¢
One_Input(struct student *head);// è¾å
¥æ绩模å
Two_Inquires(struct student *head);//æ¥è¯¢æ¨¡å
Name_inquires(struct student *head);// å§åæ¥è¯¢
Course_inquires(struct student *head);//ç§ç®æ¥è¯¢
Ranking_inquires(struct student *head);//æ»åå次æ¥è¯¢
Three_Modified(struct student *head);//ä¿®æ¹æ绩模å
modify1(struct student *temp);//åç§ ä¿®æ¹
modify2(struct student *temp);//å¤ç§ä¿®æ¹
Four_shows(struct student *head);//æ¾ç¤ºå
¨é¨å¦çæ绩模å
void main()
{
int b;
struct student *head;
head=(struct student *)malloc(sizeof(struct student));
head->next=NULL;
do
{
Main_Interface();
scanf("%d",&b);
while(b<1||b>5)
{
printf(" 没ææ¤æ¨¡å 请éæ°è¾å
¥ (1/2/3/4/5)_______");
fflush(stdin);
scanf("%d",&b);
}
switch(b)
{
case 1 : One_Input(head);break;
case 2 : Two_Inquires(head);break;
case 3 : Three_Modified(head);break;
case 4 : Four_shows(head);break;
case 5 : printf("\n\n\n\t\t\t");break;
}
}while(cc=='n');
}
Main_Interface()
{
printf(" å¦çæ绩管çç³»ç»ä¸»èåçé¢ï¼\n");
printf(" ********************************\n");
printf("å¦çæ绩管çç³»ç» *********************************\n");
printf("ï¼1ï¼ è¾å
¥å¦çæ绩;\n");
printf("ï¼2ï¼ æ¥è¯¢å¦çæ绩;\n");
printf("ï¼3ï¼ ä¿®æ¹å¦çæ绩;\n");
printf("ï¼4ï¼ è¾åºå¦çæ绩;\n");
printf("ï¼5ï¼ éåºç³»ç» ;\n\n");
printf(" 请éæ©ï¼1/2/3/4/5ï¼______ ");
return 0;
}
One_Input(struct student *head)
{
int count=0;
char c;
struct student *p=head;
while(p->next!=NULL)
{
p=p->next;
}
do
{
struct student *temp=(struct student *)malloc(sizeof(struct student));
printf("\nå¦çæ绩è¾å
¥æ¨¡åçé¢\n");
printf("****************************************\n");
printf("请è¾å
¥å¦ç:");
printf(" å¦å·__");
scanf("%d",&temp->stu_id);
printf("\n");
printf("\t\tå§å__");
scanf("%s",temp->name);
printf("\n");
printf("\t\tè±è¯__");
scanf("%f",&temp->English);
printf("\n");
printf("\t\t计ç®æº__");
scanf("%f",&temp->computer);
printf("\n");
printf("\t\tè¯æ__");
scanf("%f",&temp->chinese);
printf("\n");
printf("\t\tæ°å¦__");
scanf("%f",&temp->math);
printf("\n");
temp->sum=temp->math+temp->chinese+temp->computer+temp->English;
temp->next=NULL;
A++;
p->next=temp;
p=temp;
printf(" æ¯å¦ç»§ç»ï¼ ï¼y/nï¼________");
while(count<1)
{
printf(" 注 æ¤å¤è¥æ¯ è¾å
¥âyâ ï¼å继ç»ä¸è¿°èåï¼è¥ä¸ºânâ åè¿å主èå.ã 请è¾å
¥ æ¯å¦ç»§ç»â__ ");
count++;
}
fflush(stdin);
scanf("%c",&c);
system("cls");
while(c!='y'&&c!='n')
{
printf(" è¾å
¥æ误 请éæ°è¾å
¥ y/n __");
fflush(stdin);
scanf("%c",&c);
}
}while(c=='y');
if(c=='n') cc='n';
system("cls");
return 0;
}
Two_Inquires(struct student *head)
{
int a;
char c;
struct student *p=head;
if(p->next==NULL)
{
printf (" 请å
è¾å
¥å¦çæ绩 å¨ä¸»èåéæ© 1 ");
cc='n';
system("cls");
return 0;
}
else
{
do
{
system("cls");
printf("\tæ¥è¯¢æ¨¡å\n\n");
printf("(1) æå§åæ¥è¯¢\n");
printf("(2) æ课ç¨æ¥è¯¢\n");
printf("(3) ææ»åå次æ¥è¯¢\n");
printf(" 请éæ© 1/2/3____ ");
scanf("%d",&a);
while(a<1||a>3)
{
printf(" 没ææ¤é项 请éæ°è¾å
¥ 1/2/3 ___ ");
scanf("%d",&a);
}
switch(a)
{
case 1 : Name_inquires(p); break;
case 2 : Course_inquires(p);break;
case 3 : Ranking_inquires(p);break;
}
printf("\nå¦ç»§ç»æ¥è¯¢ï¼ â y ï¼ç»§ç»æ¥è¯¢ n ï¼ è¿å主èåâ y/n ____ ");
fflush(stdin);
scanf("%c",&c);
while(c!='y'&&c!='n')
{
fflush(stdin);
printf(" è¾å
¥æ误 请éæ°è¾å
¥ y/n __ ");
scanf("%c\n",&c);
}
}while(c=='y');
if(c=='n') cc='n';
system("cls");
return 0;
}
}
Name_inquires(struct student *head)
{
int count;
char c[21];
struct student *pointer=head;
printf("\t\t æå§åæ¥è¯¢ \n\n ");
printf("\n è¾å
¥å§å ___ ");
scanf("%s",c);
do
{
pointer=pointer->next;
count=strcmp(c,pointer->name);
if(count==0)
{
printf(" å¦å· : ");
printf("%d\n",pointer->stu_id);
printf(" æ°å¦ ï¼");
printf("%.1f\n",pointer->math);
printf(" è¯æ ï¼");
printf("%.1f\n",pointer->chinese);
printf(" è±è¯ ï¼");
printf("%.1f\n",pointer->English);
printf(" 计ç®æº ï¼");
printf("%.1f\n",pointer->computer);
}
}
while(pointer->next!=NULL);
}
Course_inquires(struct student *head)
{
char c;
float count=0;
float h_score,l_score,t_score=0,average;
struct student *pointer=head;
printf("è¾å
¥è¯¾ç¨å \n\t æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J \n\t 请è¾å
¥____ ");
fflush(stdin);
scanf("%c",&c);
while(c!='M'&&c!='C'&&c!='E'&&c!='J')
{
printf(" 没ææ¤ç§ç® 请éæ°è¾å
¥ æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J 请è¾å
¥____");
scanf("%c",&c);
}
switch(c)
{
case 'M' :
h_score=0;
l_score=5000;
while(pointer->next!=NULL)
{ pointer=pointer->next;
printf(" å¦ç å§å ï¼");
printf("%s ",pointer->name);
printf("å¦çæ°å¦æ绩ï¼");
printf("\t%.1f\n\n",pointer->math);
t_score=t_score+pointer->math;
if(pointer->math>h_score) h_score=pointer->math;
if(pointer->math<l_score) l_score=pointer->math;
count++;
}
average=t_score/count;
printf(" å¹³åå ï¼");
printf("%.1f\n",average);
printf(" æé«å ï¼");
printf("%.1f\n",h_score);
printf(" æä½å ï¼");
printf("%.1f\n",l_score);break;
case 'C' :
h_score=0;
l_score=5000;
while(pointer->next!=NULL)
{
pointer=pointer->next;
printf(" å¦ç å§å ï¼");
printf("%s ",pointer->name);
printf("å¦çè¯ææ绩ï¼");
printf("\t%.1f\n",pointer->chinese);
t_score=t_score+pointer->chinese;
if(pointer->chinese>h_score) h_score=pointer->chinese;
if(pointer->chinese<l_score) l_score=pointer->chinese;
count++;
}
average=(float)t_score/count;
printf(" å¹³åå ï¼");
printf("%.1f\n",average);
printf(" æé«å ï¼");
printf("%.1f\n",h_score);
printf(" æä½å ï¼");
printf("%.1f\n",l_score);break;
case 'E' :
h_score=0;
l_score=5000;
while(pointer->next!=NULL)
{
pointer=pointer->next;
printf(" å¦ç å§å ï¼");
printf("%s ",pointer->name);
printf("å¦çè±è¯æ绩ï¼");
printf("\t%.1f\n",pointer->English);
t_score=t_score+pointer->English;
if(pointer->English>h_score) h_score=pointer->English;
if(pointer->English<l_score) l_score=pointer->English;
count++;
}
average=(float)t_score/count;
printf(" å¹³åå ï¼");
printf("%.4f\n",average);
printf(" æé«å ï¼");
printf("%.1f\n",h_score);
printf(" æä½å ï¼");
printf("%.1f\n",l_score);break;
case 'J' :
h_score=0;
l_score=5000;
while(pointer->next!=NULL)
{
pointer=pointer->next;
printf(" å¦ç å§å ï¼");
printf("%s ",pointer->name);
printf("å¦ç计ç®æºæ绩ï¼");
printf("\t%.1f\n",pointer->computer);
t_score=t_score+pointer->computer;
if(pointer->computer>h_score) h_score=pointer->computer;
if(pointer->computer<l_score) l_score=pointer->computer;
count++;
}
average=(float)t_score/count;
printf(" å¹³åå ï¼");
printf("%.4f\n",average);
printf(" æé«å ï¼");
printf("%.1f\n",h_score);
printf(" æä½å ï¼");
printf("%.1f\n",l_score);break;
}
}
Ranking_inquires(struct student *head)
{
int B=A,i=0;
struct student *temp=head;
struct student *p=head;
struct student *q=head;
printf("\t\t ææ»å å次æ¥è¯¢ \n ");
printf("å§å æ»å å次\n");
while(p->next!=NULL&&A>1)//æ ¹æ®æåçæ绩对ç»æä½ è¿è¡æåº
{
p->sum=p->math+p->English+p->chinese+p->computer;
q=p->next;
p=p->next;
while(q->next!=NULL)
{
q=q->next;
if(p->sum<q->sum)
{
h.stu_id1=p->stu_id;
strcpy(h.name1,p->name);
h.English1=p->English;
h.computer1=p->computer;
h.math1=p->math;
h.sum1=p->sum;
h.chinese1=p->chinese;
p->stu_id=q->stu_id;
strcpy(p->name,q->name);
p->English=q->English;
p->computer=q->computer;
p->math=q->math;
p->sum=q->sum;
p->chinese=q->chinese;
q->stu_id=h.stu_id1;
strcpy(q->name,h.name1);
q->English=h.English1;
q->computer=h.computer1;
q->math=h.math1;
q->sum=h.sum1;
q->chinese=h.chinese1;
}
}
A--;
++i;
p->ranking=i;
}
p=p->next;
p->ranking=++i;
while(temp->next!=NULL)
{
temp=temp->next;
printf(" %s\t\t",temp->name);
printf("%.1f\t\t",temp->sum);
printf(" %d\n",temp->ranking);
}
}
Three_Modified(struct student *head)
{
int id;
char c;
struct student *p=head;
if(p->next==NULL)
{
printf (" 请å
è¾å
¥å¦çæ绩 å¨ä¸»èåéæ© 1 ");
cc='n';
system("cls");
return 0;
}
else
{
do
{
printf(" ä¿®æ¹æ绩模å \n");
printf(" 请è¾å
¥ 该å¦ççå¦å·_____ ");
fflush(stdin);
scanf("%d",&id);
while(p->next!=NULL)
{
p=p->next;
if(id==p->stu_id)
{
printf(" å¦çå§å ï¼ %s\n\t",p->name);
printf(" æ°å¦æ绩 ï¼ %.1f\n\t",p->math);
printf(" è¯ææ绩 ï¼ %.1f\n\t",p->chinese);
printf(" è±è¯æ绩 ï¼ %.1f\n\t",p->English);
printf(" 计ç®æºæ绩 ï¼%.1f\n\t",p->computer);
printf("\n ä¿®æ¹ä¸ç§(o)è¿æ¯å¤ç§(m) o/m ___ ");
fflush(stdin);
scanf("%c",&c);
while(c!='o'&&c!='m')
{
printf(" è¾å
¥æ误 请éæ°è¾å
¥ o/m __");
fflush(stdin);
scanf("%c",&c);
}
switch(c)
{
case 'o' : modify1(p);break;
case 'm' : modify2(p);break;
}
}
}
printf("æ¯å¦è¿å主èåï¼ y/n __ ");
fflush(stdin);
scanf("%c",&c);
while(c!='y'&&c!='n')
{
printf(" è¾å
¥æ误 éæ°è¾å
¥ y/n ");
fflush(stdin);
scanf("%c",&c);
}
}
while(c=='n');
if(c=='y') cc='n';
system("cls");
return 0;
}
}
modify1(struct student *temp)
{
char c;
printf("请è¾å
¥ æ¨è¦ä¿®æ¹çç§ç® æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J ____ ");
fflush(stdin);
scanf("%c",&c);
while(c!='M'&&c!='C'&&c!='E'&&c!='J')
{
printf("è¾å
¥é误 éæ°è¾å
¥ æ¨è¦ä¿®æ¹çç§ç® æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J ____ ");
fflush(stdin);
scanf("%c",&c);
}
switch(c)
{
case 'M':
printf("åæ°å¦æç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°æ°å¦æ绩 ï¼");
scanf("%.1f\n",&temp->math);
printf(" ä¿®æ¹å®æ !\n ");break;
case 'C':
printf("åè¯ææç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è¯ææ绩 ï¼");
scanf("%.1f\n",&temp->chinese);
printf(" ä¿®æ¹å®æ !\n ");break;
case 'E' :
printf("åè±è¯æç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è±è¯æ绩 ï¼");
scanf("%.1f\n",&temp->English);
printf(" ä¿®æ¹å®æ ! \n");break;
case 'J' :
printf("å计ç®æºæç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è®¡ç®æºæ绩 ï¼");
scanf("%.1f\n",&temp->computer);
printf(" ä¿®æ¹å®æ !\n ");break;
}
}
modify2(struct student *temp)
{
int i=0;
int count=1;
char c[5];
while(count==1&&i<5)
{
printf(" \n请è¾å
¥æ¨è¦ä¿®æ¹ç第%d个ç§ç® æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J _____",i+1);
fflush(stdin);
scanf("%c",&c[i]);
while(c[i]!='M'&&c[i]!='C'&&c[i]!='E'&&c[i]!='J')
{
printf("\nè¾å
¥é误 éæ°è¾å
¥ æ¨è¦ä¿®æ¹çç§ç® æ°å¦==Mï¼è¯æ==Cï¼è±è¯==Eï¼è®¡ç®æº==J ____ ");
fflush(stdin);
scanf("%c",&c[i]);
}
switch(c[i])
{
case 'M':
printf("åæ°å¦æç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°æ°å¦æ绩 ï¼__");
scanf("%.1f\n",&temp->math);
printf(" ä¿®æ¹å®æ !\n ");
printf("æ¯å¦ 继ç»ä¿®æ¹? 1/0 (1:继ç»ä¿®æ¹æ绩 0:éåºç³»ç») __ ");
fflush(stdin);
scanf("%d",&count);break;
case 'C':
printf("åè¯ææç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è¯ææ绩 ï¼__");
scanf("%.1f\n",&temp->chinese);
printf(" ä¿®æ¹å®æ !\n ");
printf("æ¯å¦ 继ç»ä¿®æ¹? 1/0 (1:继ç»ä¿®æ¹æ绩 0:éåºç³»ç») __ ");
fflush(stdin);
scanf("%d",&count);break;
case 'E' :
printf("åè±è¯æç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è±è¯æ绩 ï¼__");
scanf("%.1f\n",&temp->English);
printf(" ä¿®æ¹å®æ ! \n");
printf("æ¯å¦ 继ç»ä¿®æ¹? 1/0 (1:继ç»ä¿®æ¹æ绩 0:éåºç³»ç»)__ ");
fflush(stdin);
scanf("%d",&count);break;
case 'J' :
printf("å计ç®æºæç»©ä¸ºï¼ %.1f\n",temp->math);
printf("请è¾å
¥æ°è®¡ç®æºæ绩 ï¼__");
scanf("%.1f\n",&temp->computer);
printf(" ä¿®æ¹å®æ !\n ");
printf("æ¯å¦ 继ç»ä¿®æ¹? 1/0(1:继ç»ä¿®æ¹æ绩 0:éåºç³»ç») __ ");
fflush(stdin);
scanf("%d",&count);break;
}
i++;
}
}
Four_shows(struct student *head)
{
struct student *p=head;
struct student *q=head;
struct student *p5=head;
struct stu h;
int i=0,C=A;char c;
float sum=0;
struct score *head1=(struct score *)malloc(sizeof(struct score));
struct score *p4=head1;
struct student *temp=head;
struct score *p2=head1;
struct score *temp1=head1;
struct score *p3=head1;
head1->next1=NULL;
if(p->next==NULL)
{
printf (" 请å
è¾å
¥å¦çæ绩 å¨ä¸»èåéæ© 1 ");
cc='n';
system("cls");
return 0;
}
else
{
printf("\n\n è¾åºæ¨¡å\n ");
printf("-------------------------------------------------------------------\n");
printf(" å¦å· å§å æ°å¦ è¯æ è±è¯ 计ç®æº æ»å å次");
if(A==1)
{
p5=p5->next;
p5->ranking=1;
printf("\n %d\t",p5->stu_id);
printf("%s\t",p5->name);
printf("%.1f\t",p5->math);
printf("%.1f\t",p5->chinese);
printf("%.1f\t",p5->English);
printf("%.1f\t",p5->computer);
printf("%.1f\t",p5->sum);
printf(" %d",p5->ranking);
}
while(p->next!=NULL&&A>1)
{
p->sum=p->math+p->English+p->chinese+p->computer;
q=p->next;
p=p->next;
while(q->next!=NULL)
{
q=q->next;
if(p->sum<q->sum)
{
h.stu_id1=p->stu_id;
strcpy(h.name1,p->name);
h.English1=p->English;
h.computer1=p->computer;
h.math1=p->math;
h.sum1=p->sum;
h.chinese1=p->chinese;
p->stu_id=q->stu_id;
strcpy(p->name,q->name);
p->English=q->English;
p->computer=q->computer;
p->math=q->math;
p->sum=q->sum;
p->chinese=q->chinese;
q->stu_id=h.stu_id1;
strcpy(q->name,h.name1);
q->English=h.English1;
q->computer=h.computer1;
q->math=h.math1;
q->sum=h.sum1;
q->chinese=h.chinese1;
}
}
A--;
++i;
p->ranking=i;
}++i;
p=p->next;
p->ranking=++i;
i=0;
while(i<4)
{
struct score *p1=(struct score *)malloc(sizeof(struct score));
struct student *p=head;
p1->next1=NULL;
p1->h_score=0;
p1->l_score=1000;
sum=0;
while(p->next!=NULL)
{
if(i==0)
{
p=p->next;
sum=sum+p->math;
if(p1->h_score<p->math)
{
p1->h_score=p->math;
}
if(p1->l_score>p->math)
{
p1->l_score=p->math;
}
}
if(i==1)
{
p=p->next;
sum=sum+p->chinese;
if(p1->h_score<p->chinese)
{
p1->h_score=p->chinese;
}
if(p1->l_score>p->chinese)
{
p1->l_score=p->chinese;
}
}
if(i==2)
{
p=p->next;
sum=sum+p->English;
if(p1->h_score<p->English)
{
p1->h_score=p->English;
}
if(p1->l_score>p->English)
{
p1->l_score=p->English;
}
}
if(i==3)
{
p=p->next;
sum=sum+p->computer;
if(p1->h_score<p->computer)
{
p1->h_score=p->computer;
}
if(p1->l_score>p->computer)
{
p1->l_score=p->computer;
}
}
}
i++;
p1->average=sum/C;
temp1->next1=p1;
temp1=p1;
}
while(p5->next!=NULL)
{
p5=p5->next;
printf("\n %d\t",p5->stu_id);
printf("%s\t",p5->name);
printf("%.1f\t",p5->math);
printf("%.1f\t",p5->chinese);
printf("%.1f\t",p5->English);
printf("%.1f\t",p5->computer);
printf("%.1f\t",p5->sum);
printf(" %d",p5->ranking);
}
printf("\n\nå¹³åå\t\t");
while(p2->next1!=NULL)
{
p2=p2->next1;
printf("%.1f\t",p2->average);
}
printf("\næé«å\t\t");
while(p3->next1!=NULL)
{
p3=p3->next1;
printf("%.1f\t",p3->h_score);
}
printf("\næä½å\t\t");
while(p4->next1!=NULL)
{
p4=p4->next1;
printf("%.1f\t",p4->l_score);
}
printf("\n\n-------------------------------------------------------------------\n\t");
printf("éæ© n è¿å主èå __ ");fflush(stdin);
scanf("%c",&c);
while(c!='n')
{
printf(" è¾å
¥æ误 éæ°è¾å
¥ n -___ã");
scanf("%c",&c);
}
cc='n';
system("cls");
return 0;
}
}
符åä½ çé£ä¸ª è¦æ± ä½æ¯å½æ°åä¸åãã
追é®tcç¯å¢ä¸è½è¿è¡ä¸æåï¼
追çè¯è¯å æä¹ä¸ç¥é åºè¯¥ä¸ç¥éããã ç»å åä¸ å¿å¿ãã
è¦æ¯ä¸è¡çè¯ æä¸æçé¨å æ¹æè±è¯å°±å¯ä»¥äºã
追é®è¿ä¸ªå¤ªå¤æäº äº¤ä¸å»èå¸ä¸ç¼å°±çåºæ¥ä¸æ¯æèªå·±åç è½ä¸è½æä¸ä¸ªç¸å¯¹ç®åä¸ç¹çåï¼
å¦ææ¹ä¸ä¸ªç¨åºçè¯ ä¼å åç
å¸®å¸®å¿ å~~~·
追ç#include "stdio.h"
#include "string.h"
struct student
{
int id;
float math;
float chinese;
float english;
float total;
float average;
char name[20];
}stu[3];
float t_average=0,sum=0;
float highest;
char name1[20];
input()
{
int i=0;
for(i=0;i<3;i++)
{
printf("The data input %d students",i+1);
printf(" input Student_id __ ");
scanf("%d",&stu[i].id);
getchar();
printf("\ninput stu_name__ ");
scanf("%s",stu[i].name);
getchar();
printf("\ninput math_scores __ ");
scanf("%f",&stu[i].math);
getchar();
printf(" \n input chinese_scores __ ");
scanf("%f",&stu[i].chinese);
getchar();
printf(" \n input english_scores __ ");
scanf("%f",&stu[i].english);
getchar();
}
return 0;
}
average()
{
int i;
for(i=0;i<3;i++)
{
stu[i].total=stu[i].math+stu[i].chinese+stu[i].english;
stu[i].average=stu[i].total/3;
sum+=stu[i].total;
}
t_average=sum/3;
}
maximum()
{
int i=0;
strcpy(name1,stu[i].name);
highest=stu[i].total;
for(;i<3;i++)
{
if(highest<stu[i].total)
{
highest=stu[i].total;
strcpy(name1,stu[i].name);
}
}
}
void main()
{
int i;
input();
average();
maximum();
printf("NO\tname\tmath\tchinese\tenglish\ttotal\taverage");
for(i=0;i<3;i++)
{
printf("\n%d",stu[i].id);
printf("\t%s",stu[i].name);
printf("\t%.1f",stu[i].math);
printf("\t%.1f",stu[i].chinese);
printf("\t%.1f",stu[i].english);
printf("\t%.1f",stu[i].total);
printf("\t%.1f",stu[i].average);
}
printf("\nt_average=%.2f",t_average);
printf("\nThe highest_nameï¼ %s",name1);
printf("\tscore totalï¼ %.f",highest);
}
è¿ä¸ªæ¯ç¬¦åä½ è¦æ±ç é¢ãã