unsigned int timecounter[54]={0}; /全局变量/
void state()
{
a=0;
b=0;
c=0;
for(icount=0;icount<54;icount++)
{
if (timecounter[icount]>0)
{
timecounter[icount]—-;
}
else if(timecounter[icount]==0x0)
{
if ((a!=0))
{
关断输出;
}
else if(userorder!=0x0)
{
timecounter[icount]=600;
c++;
if(c>3)
{
timecounter[icount]=0;
a=0x2;
}
else{;}
}
else
{;}
}
else{;}
}
}
while (1)
{
void main()
{
state();
}
}
问一下各位,这段代码执行有啥问题没,想实现个尝试三次输出之后彻底关断的代码,每次输出后等待600个计数,再重新开始输出,现在第一次倒计时结束后好像就无法再尝试输出了,代码有什么问题吗?userorder的值一直是不为0的。
你这代码,问题很大啊:
(1)中英文标点混在一起了。
(2)main怎么嵌套在while(1)里
(3)userorder似乎没定义吧。
贴个正确的代码比较好。