请高手帮忙指出错误啊
#include<stdio.h>#include<stdlib.h>
typedef struct student
{
int num;
char name[10];
float score;
struct student *next;
}link;
link *listcreat(int n)
{
link *head;
link *p,*s;
int i;
if((head=(link *)malloc(sizeof(link)))==NULL){
printf("内存分配失败!\n");
exit(0);
}
head->next=NULL;
p=head;
for(i=0;i<n;i++){
if((s=(link *)malloc(sizeof(link)))==NULL){
printf("内存分配失败!\n");
exit(0);
}
p->next=s;
printf("第%d个人:\n学号 姓名 成绩:\n",i+1);
scanf("%d,%s,%f",s->num,s->name,s->score);
s->next=NULL;
p=s;
}
return head;
}
void main()
{
link *head;
int n;
printf("********学生信息管理系统*********\n");
printf("请输入人数:");
scanf("%d",&n);
head=listcreat(n);
}