题目
答案
void input()
{
int n;
scanf("%d",&n);
if(n==0) return;
struct stud_node *temp = (struct stud_node *)malloc(sizeof(struct stud_node));
head=temp;
head->next=NULL;
head->num=n;
scanf("%s",&head->name);
scanf("%d",&head->score);
struct stud_node *p=head;
tail=p;
scanf("%d",&n);
while(n!=0)
{
struct stud_node *temp = (struct stud_node *)malloc(sizeof(struct stud_node));
p->next=temp;tail=p->next;
p=p->next;
temp->num=n;
scanf("%s",&temp->name);
scanf("%d",&temp->score);
scanf("%d",&n);
}
}