急!急!寻求一个C语言课程设计(学籍管理系统)

来源:百度知道 编辑:UC知道 时间:2024/05/30 08:36:49
要求有结构体和共同体,指针,数组,循环等等,能在TC2.0下运行就行,全英文的 ̄ ̄

#include <stdio.h>
#include <stdlib.h>
#define NULL 0
#define LEN sizeof(struct student)
struct student
{long num;
char sex;
int age;
float score[3];
char name[20];
struct student *next;
};
int n;
struct student *creat(void)
{struct student * head;
struct student * p1,* p2;
n=0;
p1=p2=(struct student * )malloc(LEN);
scanf("%ld,%c,%d,%f,%f,%f,%s",&p1->num,&p1->sex,&p1->age,&p1->score[0],&p1->score[1],&p1->score[2],p1->name);
head=p1;
while(p1->num!=0)
{n=n+1;
if(n!=1)
p2->next=p1;
p2=p1;
p1=(struct student * )malloc(LEN);
scanf("%ld,%c,%d,%f,%f,%f,%s",&p1->num,&p1->sex,&p1->age,&p1->score[0],&p1->score[1],&p1->score[2],p1->name);
}
p2->next=NULL;
return(head);
}
void print(struct student *head)
{struct student * p