华南农业大学数据结构上机答案实验 联系客服

发布时间 : 星期一 文章华南农业大学数据结构上机答案实验更新完毕开始阅读

cha->top=-1; num->top=-1;

ch='#'; Push(cha,ch); ch=getchar();

while(ch!='='||(top=Gettop(cha))!='#') { if(In(ch)) {

temp=ch-'0';

ch=getchar();

while(In(ch)) {

temp=temp*10+ch-'0';

ch=getchar(); }

Push1(num,temp); }

else if(ch=='.') {

ch=getchar();

while(ch=='0') ch=getchar(); } else {

top=Gettop(cha);

switch (compare(top,ch))

{ case '<': Push(cha,ch); ch=getchar(); break;

case '=': Pop(cha,&x);

ch=getchar(); break;

case '>': Pop1(num,&m); Pop1(num,&n); Pop(cha,&op); d=claculat(n,op,m); Push1(num,d); break; } } }

Pop1(num,&d); printf("%d\\n",d); Pop(cha,&ch); Pop1(num,&temp); ch=getchar();

}

8590 队列的应用——银行客户平均等待时间 时间限制:1000MS 内存限制:1000K 提交次数:176 通过次数:83

题型: 编程题 语言: 无限制

Description

某银行有一个客户办理业务站,在一天内随机地有客户到达,设每位客户的业务办理时间是某个范围内的值。设只有一个窗口,一位业务人员,要求程序模拟统计在一天时间内,所有客户的平均等待时间。模拟数据按客