#include<stdio.h>
#include<windows.h>
struct student
{ int num;
float mid;
float end;
struct student *next;};
int n;
struct student *lucifer()
{struct student *head,*p1,*p2;
n=0;
p1=p2=(struct student*)malloc(sizeof(struct student));
scanf("%d",&p1->num);
scanf("%f",&p1->mid);
scanf("%f",&p1->end);
while(p1->num!=0)
{n=n+1;
if(n==1) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student*)malloc(sizeof(struct student));
scanf("%d",&p1->num);
scanf("%f",&p1->mid);
scanf("%f",&p1->end);
}
return(head);
}p1->next=NULL;
void main()
{printf("請輸入學生學號和期中期末成績\n");
struct student *p;
p=lucifer();
do{printf("學號是%d\t期中成績%f\t期末成績%f\n",p->num,p->mid,p->end);
p=p->next;}
while(p!=NULL);
}這個應該可以額 有什麽可以交流