switch 的case 0和case 2有几句不执行?请教!
#include <reg52.h>sbit ENLED = P1^4;
sbit ADDR3 = P1^3;
sbit ADDR2 = P1^2;
sbit ADDR1 = P1^1;
sbit ADDR0 = P1^0;
main()
{ unsigned int n=0;
while (1)
{ n++;
switch (n%6)
{
case 0:
ADDR0 = 0;
ADDR1 = 0;
ADDR2 = 0;
break;
case 1:
ADDR0 = 1;
ADDR1 = 0;
ADDR2 = 0;
break;
case 2:
ADDR0 = 0;
ADDR1 = 1;
ADDR2 = 0;
break;
case 3:
ADDR0 = 1;
ADDR1 = 1;
ADDR2 = 0;
break;
case 4:
ADDR0 = 0;
ADDR1 = 0;
ADDR2 = 1;
break;
case 5:
ADDR0 = 1;
ADDR1 = 0;
ADDR2 = 1;
break;
} } }