电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

源程序(医院药房药品管理系统C++)VIP专享VIP免费

源程序(医院药房药品管理系统C++)_第1页
源程序(医院药房药品管理系统C++)_第2页
源程序(医院药房药品管理系统C++)_第3页
1 源程序: # include //包含文件读写 # include # include //包含strcmp()字符是否相等 #include //包含system("cls")清屏 #define MAX 60 //下列字符数组的大小 struct Date{//日期 char year[MAX];//年 char month[MAX];//月 char day[MAX];//日 }; struct Goods{//药品信息 char name[MAX];//药品名称 char price[MAX];//药品价格 char number[MAX];//药品数量 char cost[MAX];//药品总价 char kind[MAX];//药品的种类 Date indate;//入库日期 Date xiaoqi;//到期时间 Goods * next;//下一个结点 }; class Cangkuguanli { //类定义与实现 private: int length;//客户数量 Goods * head;//列表的头结点 Goods * current;//当前结点 public: Cangkuguanli()//构造函数 { head=new Goods;//创建头结点 current=head; current->next=NULL; length=0;//长度为 0 } void Creatlist()//创建新的列表 { char g='Y'; int s=0; length=0;//初始长度为 0; current=head; do { 2 Goods * temp=new Goods ;//构建新结点信息 length++; //每加一个结点 链表长度增 1 temp->next=NULL; cout<<" 请输入药品名称: "; cin>>temp->name; cout<<" 请输入单价 : "; cin>>temp->price; cout<<" 请输入药品数量: "; cin>>temp->number; cout<<" 请输入总费用 : "; cin>>temp->cost; cout<<" 请输入日期 (**** ** **) : "; cin>>temp->indate.year>>temp->indate.month>>temp->indate.day; cout<<" 请输入药品有效期 (**** ** **):"; cin>>temp->xiaoqi.year>>temp->xiaoqi.month>>temp->xiaoqi.day; cout<<" 请输入药品种类: "; cin>>temp->kind; if(head==NULL){head=temp;current=temp;} //head 头指针,current 尾指针 else {current->next=temp,current=temp;} do{ cout<<" next ? (Y N) "; //是否继续存入新产品 cin>>g; if(g!='Y'&&g!='N') { cout<<"\n error \n "; } }while(g!='Y'&&g!='N'); }while(g=='Y');//判断是否继续插入新结点 } void Open ()//打开一个数据文件,并建立链表关联 和文件中的记录对应 { char fname[20];//文件名称 cout<<" input the name of the file \n"; cin>>fname; //输入要打开的文件名 ifstre...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部