这个适合初学者去学习!!
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//1、确定数据类型信息
typedef struct patient
{
char ID[10]; //编号
char name[10]; //姓名
char details[300]; //具体信息
int cost[3]; //话费金额
struct patient * next;
}node1;
typedef struct storage
{
int amount[3]; //药品数量
int price[3]; //价格
}node2;
node2 init(node2 temp)
{
temp.amount[0]=20;
temp.amount[1]=20;
temp.amount[2]=10;
temp.price[0]=5;
temp.price[1]=9;
temp.price[2]=16;
return temp;
}
void mainmeun()
{
//2、选择输入项
printf("\n");
printf("*************欢迎使用医疗管理系统*******************\n");
printf("1.注册学生信息\n");
printf("2.查询学生信息\n"); //4、输出项
printf("3.填写详细信息\n");
printf("4.学生购买消费\n");//3、用于计算项
printf("5.列出所有学生信息\n"); //5、输出所以学生信息
printf("6.查询药品库存\n");
printf("7.退出系统\n");
printf("**************请选择操作项******************\n");
}
node1 * create(node1 *p1) //注册学生信息
{
node1 *p;
p=(node1 *)malloc(sizeof(node1));
printf("请输入学生编号\n");
scanf("%s",p->ID);
while(p1->ID&&strcmp(p1->ID,p->ID))
{
p1=p1->next