C语言学生信息管理系统未完成部分!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C语言学生信息管理系统未完成部分!相关的知识,希望对你有一定的参考价值。

C语言的大神们,程序编译运行是没有毛病,但是用system("pause")卡住看程序地址怎么出现这样的毛病?本人新手一枚,请各位大神指点一下!谢谢。

参考技术A 这个我c语言结构与链表的作业:
#include
#include

struct staff
char num[6]; //学号
char name[20]; //姓名
double wage; //成绩
struct staff *next;
;

/**
*输入数据
*/
struct staff *create(int n)
struct staff *head=NULL;
struct staff *tail,*newnode;
char num[6],name[20];
double wage;
for(int i=0;i<n;i++)
newnode = new staff;
scanf("%s",num);
scanf("%s",name);
scanf("%lf",&wage);
strcpy(newnode->num,num);
strcpy(newnode->name,name);
newnode->wage=wage;
if(head==NULL)
head = newnode;
else
tail->next = newnode;
tail=newnode;

tail->next=NULL;
return(head);


/**
*删除数据
*/
struct staff *deln(struct staff *head,int n)
struct staff *p,*q;
int i=0;
p=head;
while(++i!=n && p->next!=NULL)
q=p;
p=p->next;

if(i==n)
if(p==head) head=p->next;
else q->next=p->next;
delete(p);
else
printf("Not been found!\n");
return(head);


/**
*显示数据
*/
void showdate(struct staff *head)
struct staff *p=head;
int i=1;
while(p!=NULL)
printf("%d| %s,%s,%.2f\n",i++,p->num,p->name,p->wage);
p=p->next;



void main()
struct staff *head;
int n;
printf("请输入初始链表结点数 ");
scanf("%d",&n);
head=create(n);
printf("删除前:\n");
showdate(head);
int m=0;
while(mn)
printf("请输入要删除的结点号:\n");
scanf("%d",&m);

head=deln(head,m);
printf("删除后:\n");
showdate(head);

以上是关于C语言学生信息管理系统未完成部分!的主要内容,如果未能解决你的问题,请参考以下文章

c语言 学生管理系统

用栈完成学生信息管理删除和撤销(C语言)

用C语言做学生信息管理系统设计

学生成绩管理系统的c语言程序

用C语言设计一个学生信息查询系统程序

学生信息管理系统(C语言)