void press()
{
do
{
dat=get_key();//获取键
if(dat>=0&&dat<10)
{
count++;
if(count==1)
{
pricetable[0]=dat;
price_shuzhi(3,pricetable[0]+0x30);
}
if(count==2)
{
pricetable[1]=pricetable[0];
price_shuzhi(2,pricetable[1]+0x30);
pricetable[0]=dat;
price_shuzhi(3,pricetable[0]+0x30);//显示单价
}
if(count==3)
{
pricetable[2]=pricetable[1];
price_shuzhi(1,pricetable[2]+0x30);
pricetable[1]=pricetable[0];
price_shuzhi(2,pricetable[1]+0x30) ;
pricetable[0]=dat;
price_shuzhi(3,pricetable[0]+0x30);//显示
}
}
if(dat==12)
{
count--;
if(count==0) //清除
{price_shuzhi(3,' ');}
if(count==1)
{
pricetable[1]=pricetable[2] ;
price_shuzhi(3,pricetable[1]+0x30);
price_shuzhi(2,' ');
}
if(count==2)
{
pricetable[0]=pricetable[1];
price_shuzhi(3,pricetable[0]+0x30) ;
pricetable[1]=pricetable[2];
price_shuzhi(2,pricetable[1]+0x30);
price_shuzhi(1,' ');}
}
}
while(dat!=14) ;
}
为什么实现不了操作个位,输入后按键14确定?急!!!!!
0