商品货架管理—数据结构课程设计报告
else
{
top++;
stack[top].num=x;
stack[top].date.Day=day;
stack[top].date.Month=month;
stack[top].date.Year=year;
}
}
void pop()
{
if(top==0)
cout<<"货架已空"<<endl;
else
top--;
}
elemtype gettop()
{
if(top==0)
cout<<"货架已空"<<endl;
else
return top;}
bool empty()
{
return top==0;
}
};
void main()
{
seqstack c[k+1]; //存放k种商品的数组,用c[0]来做中介货架
int Txq[k+1]; //第i种取货用的时间
int Txs[k+1]; //第i种上货用的时间
int Nx[k+1]; //第i种每天的销售数量
int N=0; //每天销售总量
int Tx[k+1]; //第i种每天上货的总时间
int T=0; //每天上货用的总时间