我想知道如何仅使用 IF、WHILE 或 FOR(没有 switch/case 语句)编写以下代码?
if(ulDataBuf!=15 && ulData==15)
{
switch(ulDataBuf){
case 14:
timeON+=500000;
break;
case 13:
if(timeON!=0) timeON-=500000;
break;
case 11:
timeOFF+=500000;
break;
case 7:
if(timeOFF!=0) timeOFF-=500000;
break;
}
}