#include"stdio.h"
#include"stdlib.h"
#include"conio.h"
#include"string.h"
#include<time.h>
#include<windows.h>
#pragma comment(lib,"winmm.lib")
struct Nobel
{
char name[30];//姓名
char sex[10];//性别
int time;//年份
char Nat[30];//国籍
char prize[60];//奖项
struct Nobel *next;
};
void systemTime()
{
time_t t;
time(&t);
printf("%s",ctime(&t));
}
void Scr()
{
printf("\n\n\n");
systemTime();
printf("\n\n ************************欢迎进入诺贝尔获奖者信息管理系统********************\n");
printf(" -------------------------------^_^--------------------------------------\n\n");
printf(" 1--录入诺贝尔获奖者信息\n");
printf(" 2--删除诺贝尔获奖信息\n");
printf(" 3--增添诺贝尔获奖信息\n");
printf(" 4--修改诺贝尔获奖信息\n");
printf(" 5--输出诺贝尔获奖信息\n");
printf(" 6--查询诺贝尔获奖信息\n");
printf(" 7--统计诺贝尔获奖\n");
printf(" 0--退出系统\n\n");
printf(" --------------------------------^_^-------------------------------------\n\n");
}
int count=0;
struct Nobel *creat()//创建链表
{
struct Nobel *pHead,*pNew;
pHead=(struct Nobel*)malloc(sizeof(struct Nobel));
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
pHead->next=pNew;
system("pause");
system("cls");
Scr();
return pHead;
}
void creat2(struct Nobel *pHead)//创建链表
{
struct Nobel *pNew,*p=pHead;
int i;
for(i=0;i<count;i++)
p=p->next;
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
p->next=pNew;
system("pause");
system("cls");
Scr();
}
void Insert(struct Nobel *pHead,char b[])//插入信息
{
struct Nobel *pNew,*p=pHead->next;
while(strcmp(b,p->name)&&p!=NULL)
p=p->next;
if(p==NULL)
printf("您输入的信息有误^_^!\n请核对后再次输出!\n");
else{
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
p->next=pNew;}
system("pause");
system("cls");
Sc
#include"stdlib.h"
#include"conio.h"
#include"string.h"
#include<time.h>
#include<windows.h>
#pragma comment(lib,"winmm.lib")
struct Nobel
{
char name[30];//姓名
char sex[10];//性别
int time;//年份
char Nat[30];//国籍
char prize[60];//奖项
struct Nobel *next;
};
void systemTime()
{
time_t t;
time(&t);
printf("%s",ctime(&t));
}
void Scr()
{
printf("\n\n\n");
systemTime();
printf("\n\n ************************欢迎进入诺贝尔获奖者信息管理系统********************\n");
printf(" -------------------------------^_^--------------------------------------\n\n");
printf(" 1--录入诺贝尔获奖者信息\n");
printf(" 2--删除诺贝尔获奖信息\n");
printf(" 3--增添诺贝尔获奖信息\n");
printf(" 4--修改诺贝尔获奖信息\n");
printf(" 5--输出诺贝尔获奖信息\n");
printf(" 6--查询诺贝尔获奖信息\n");
printf(" 7--统计诺贝尔获奖\n");
printf(" 0--退出系统\n\n");
printf(" --------------------------------^_^-------------------------------------\n\n");
}
int count=0;
struct Nobel *creat()//创建链表
{
struct Nobel *pHead,*pNew;
pHead=(struct Nobel*)malloc(sizeof(struct Nobel));
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
pHead->next=pNew;
system("pause");
system("cls");
Scr();
return pHead;
}
void creat2(struct Nobel *pHead)//创建链表
{
struct Nobel *pNew,*p=pHead;
int i;
for(i=0;i<count;i++)
p=p->next;
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
p->next=pNew;
system("pause");
system("cls");
Scr();
}
void Insert(struct Nobel *pHead,char b[])//插入信息
{
struct Nobel *pNew,*p=pHead->next;
while(strcmp(b,p->name)&&p!=NULL)
p=p->next;
if(p==NULL)
printf("您输入的信息有误^_^!\n请核对后再次输出!\n");
else{
pNew=(struct Nobel*)malloc(sizeof(struct Nobel));
printf("姓名:\n");
scanf("%s",pNew->name);
printf("性别:\n");
scanf("%s",pNew->sex);
printf("年份:\n");
scanf("%d",&pNew->time);
printf("国藉:\n");
scanf("%s",pNew->Nat);
printf("所获奖项\n");
scanf("%s",pNew->prize);
count++;
pNew->next=NULL;
p->next=pNew;}
system("pause");
system("cls");
Sc