java模拟病人就诊过程_new 患者在医院看病过程:先排队等候 联合开发网 - pudn.com...

new

所属分类:其他

开发工具:C/C++

文件大小:2KB

下载次数:6

上传日期:2018-06-18 12:18:29

上 传 者:溪石

说明:  患者在医院看病过程:先排队等候,再看病治疗。

在排队的过程中主要重复做两件事情,一是患者达到诊室,将病历交给护士,排到等候队列中候诊;二是护士从等候队列中取出下一个患者的病历,该患者进入诊室看病。下班后,不再接受病人排队。按照“先到先服务”原则,设计一个算法模拟病人等候就诊的过程。

输入说明:“病人到达”通过控制台输入‘a’模拟,“护士让下一位患者就诊”通过控制台输入‘n’模拟,“不再接受病人排队” 通过控制台输入‘q’模拟。

输出说明:当有“病人到达”命令时,提示“病例号:”,输入一个整型数字后,输出“您的病例号是X,还有Y人在等候”;当有“护士让下一位患者就诊”命令时,“病例号为X的病人就诊”;当有“不再接收病人排队”命令时,则队列中所有元素出队,输出“今天看诊结束,下列病人依次就诊:X,Y,Z”,程序终止。

(Patients in the hospital: first wait in line, then see a doctor.

In the process of queuing, the main repetition of two things, one is that the patient reaches the consulting room, the medical record is handed to the nurse, and the waiting queue is waiting in the waiting queue; the two is the nurse taking the next patient's medical record from the waiting queue, and the patient enters the consulting room to see the doctor. After work, the patient is no longer in line. According to the principle of "first come, first served", an algorithm is designed to simulate the waiting process of patients.

Input Description: "patient arrival" input 'a' simulation through the console, "nurse let the next patient visit" through the console input 'n' simulation, "no longer accept patient queues" through the console input 'Q' simulation.)

文件列表:[举报垃圾]

new.c, 6052 , 2018-05-11

近期下载者:

相关文件:

收藏者:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值