文档介绍:#include<>#include<>#include<>#include<>#include<>//--------------------------------------------------结构定义------------------------------------------typedefstructCheckinInformation{ charname[10];//姓名 intid;//证件号 introomType;//房型 intcountType;//计费方式}CheckinInfo;typedefstructHotelRoom{ introomType;//房型 introomNum;//房号 intchecked;//入住情况 intprice;//房价}Room;typedefstructRoomOrder{ CheckinInfo*checkinInfo;//入住信息 longdate;//入住时间 Room*room;//房间信息}Order;typedefstructHotelInfomation{ intcheckinAmount;//已入住房数 intsingleRemainAmount;//单人房剩余房数 intdoubleRemainAmount;//双人房剩余房数 intbigRemainAmount;//大床房剩余房数}HotelInfo;//--------------------------------枚举类型---------------------------enum{MainUI,HotelInfoUI,CheckinUI,CheckinResultUI,OrderUI,CheckOutUI,Exit};//GUIenum{Single,Double,Big};//RoomTypeenum{Hour,Day};//countType//--------------------------------全局变量--------------------------intGUI=MainUI;Order*orderList[100]; //订单数组Room*roomList[100]; //房间数组HotelInfo*hotelInfo=NULL;//酒店房间信息//-------------------------------函数声明----------------------------voidinitiallizeRoomList();voidinsertToOrderList(Order*order);Room*getRoomByType(introomType);Order*getOrderByRoomNum(introomNum);voidshowMainUI();voidshowHotelInfoUI();voidshowCheckinUI();voidshowCheckinResultUI();voidshowOrderUI();voidshowCheckOutUI();//-------------------------------Main函数----------------------------voidmain()//主函数{ //初始化酒店房间信息 hotelInfo=(HotelInfo*)malloc(sizeof(HotelInfo)); hotelInfo->singleRemainAmount=20; hotelInfo->doubleRemainAmount=40; hotelInfo->bigRemainAmount=40; hotelInfo->checkinAmount=0; //初始化房间列表 initiallizeRoomList(); //界面显示 while(GUI!=Exit) { switch(GUI) { caseMainUI: showMainUI(); break; caseHotelInfoUI: showHotelInfoUI(); break; caseCheckinUI: showCheckinUI(); break; caseCheckinResultUI: showCheckinResultUI(); break; caseOrderUI: showOrderUI(); break; caseCheckOutUI: showCheckOutUI(); break; default: break; } }}//-------------------------------函数定义---------------------------