#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
using namespace std;
int open_time=60*8;
int close_time=60*22;
int now_time;
FILE *fp,*fpe;
struct date
{
int y;
int m;
int d;
int h;
int mi;
int s;
};
//获取现在时间
date get_date()
{
date dt;
time_t timp;
struct tm *p;
time(&timp);
p=gmtime(&timp);
dt.y=p->tm_year+1900;
dt.m=p->tm_mon+1;
dt.d=p->tm_mday;
dt.h=p->tm_hour+8;
dt.mi=p->tm_min;
dt.s=p->tm_sec;
return dt;
}
struct ElemType
{
int a_time;
int d_time;
int style;
int stylist;
float money;
int if_vip;
char vip[20];
};
struct ENode
{
ElemType data;
ENode *next;
};
struct Queue
{
ENode *ffront;
ENode *rear;
Queue()
{
//cout<<"Queue"<<endl;
ffront=rear=new ENode;
if(ffront==NULL)
{
printf("can not offer enough memory!\n");
exit(0);
}
ffront->next=NULL;
}
void clear()
{
ENode *p,*q;
rear=ffront;
p=ffront->next;
ffront->next=NULL;
while(p){
q=p;
p=p->next;
delete q;
}
}
void insert(ElemType e)
{
ENode *p=new ENode;
if(p==NULL)
{
printf("can not offer enough memory!\n");
exit(0);
}
p->data=e;
rear->next=p;
rear=p;
}
bool empty()
{
if(ffront==rear)
return true;
return false;
}
ElemType &top()
{
if(ffront==rear)
{
printf("1the queue is empty!");
exit(0);
}
ENode *p=ffront->next;
return p->data;
}
void pop()
{
if(ffront!=rear)
{
ENode *p=ffront->next;
ffront->next=p->next;
if(rear==p)
rear=ffront;
delete p;
}
}
int length()
{
int i=0;
ENode *q;
q=ffront;
while(q!=rear)
{
i++;
q=q->next;
}
return i;
}
void Destory()
{
while(ffront!=NULL)
{
rear=ffront->next;
delete ffront;
ffront=rear;
}
}
~Queue()
{
}
};
struct LElemType
{
int o_time;
int Ntype;
};
struct LNode
{
LElemType data;
LNode *next;
};
struct LQueue
{
LNode *ffront;
LNode *rear;
LQueue()
{
// cout<<"LQ"<<endl;
ffront=rear=new LNode;
if(ffront==NULL)
{
printf("can not offer enough memory!\n");
exit(0);
}
ffront->next=NULL;
}
void clear()
{
LNode *p,*q;
rear=ffront;
p=ffront->next;
ffront->next=NULL;
while(p){
q=p;
p=p->next;
delete q;
}
}
void insert(LElemType e)
{
LNode *p=new LNode;
if(p==NULL)
{
printf("can not offer enough memory!\n");
exit(0);
}
p->data=e;
rear->next=p;
rear=p;
}
bool empty()
{
if(ffront==rear)
return true;
return false;
}
LElemType &top()
{
if(ffront==rear)
{
printf("1the queue is empty!");
exit(0);
}
LNode *p=ffront->next;
return p->data;
}
void orderinsert(LElemType e)
{
理发馆经营状况的仿真模拟
最新推荐文章于 2021-05-24 00:02:06 发布