⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 医院模拟.cpp

📁 医院模拟:经典堆栈队列应用;VC++控制台程序;小弟上数据结构是作品.
💻 CPP
字号:
// 医院模拟.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include "queue.h"

///
void main()
{
	ListQueue *pLQ;
	pLQ=CreatListQueue();
	char keyword;
	int value;
	while(1)
	{
		printf("请输入要执行的操作:I排队,O出队就胗,Q全结束\n");
		scanf("%c",&keyword);
		switch(keyword)
		{
		case 'i':
			{
				printf("输入号码\n");
				scanf("%d",&value);
				InQueue(pLQ,value);
				break;
			}
		case 'o': 
			{	if(IsEmpty(pLQ)) {printf("对列已空\n");}
				else printf("就胗编号%d\n",OutQueue(pLQ));
				break;
			}
		case 'q':
			{
				if(IsEmpty(pLQ)) return;
				else (printf("!还有人在排对。"));
				break;
			}
		default : 
			{break;}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -