一道C语言编程题(基于TC2.0,不要出现中文)

1. 学生信息管理系统泰 1-1 需要处理的基础数据泰 学生基本信息:学生编号(3位整数)、学生姓名、性别、出生日期、身份证号(12位整数)、籍贯、家庭住址、家庭邮编(6位整数)、家庭电话、政治面貌、民族、专业方向、班级编号(4位整数)。泰 1-2 需要功能泰 (1)需要有菜单界面选项泰 (2)各种基本数据的录入。如:学生信息的录入泰 (3)各种基本数据的修改。即:允许对已经录入的数据重新进行编辑、修改。泰 (4)各种基本数据的删除。如:假设某同学转学或出国深造,删除该生的相关信息。 泰 (5)基于各种数据的查询。如:姓张的所有同学、年龄小于20岁的同学。泰 (6)基于各种基本数据的统计计算。比如各省市学生的人数;将学生信息按年龄进行排序。泰 (7)打印所有学生的基本信息.如能回答完整,愿意加满分!
2026年09月28日 11:43
有2个网友回答
网友(1):

#include
#include
#define NULL 0
#define LEN sizeof(struct student)
struct student
{long num;
int score; struct student *next;
};
int n;
struct student *creat()
{ struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=( struct student*) malloc(LEN);
scanf("%ld,%d",&p1->num,&p1->score);
head=NULL;
while(p1->num!=0)
{n=n+1;
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student*)malloc(LEN);
scanf("%ld,%d",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}

void print(struct student *head)
{ struct student *p;
printf("\nNow,These %d records are:\n",n);
p=head;
if(head!=NULL)
do
{ printf("%ld %d\n",p->num,p->score);
p=p->next;
}while(p!=NULL);
}

struct student *del(struct student *head,long num)
{ struct student *p1,*p2;
if (head==NULL){printf("\nlist null!\n");goto end;}
p1=head;
while(num!=p1->num && p1->next!=NULL)
{p2=p1;p1=p1->next;}
if(num==p1->num)
{if(p1==head)head=p1->next;
else p2->next=p1->next;
printf("delete:%ld\n",num);
n=n-1;
}
else printf("%ld not been found!\n",num);
end:
return(head);
}

struct student *insert(struct student *head, struct student *stud)
{ struct student *p0,*p1,*p2;
p1=head;
p0=stud;
if(head==NULL)
{head=p0; p0->next=NULL;}
else
{

给你这个差不多的,这是我以前做的,也是老师布置的作业~!

也用了很长的时间,关键是,你写的一定要调试才能完成正确~

所以你自己慢慢写喽~!

想要别人给你完整的答案,应该是不可能的~除非他和你做的一样的题~!

网友(2):

给多少啊 晕