第1个回答 2013-07-12
#include <reg51.h>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void show(unsigned char n);
void delay();
void main()
{
unsigned char i;
int j;
while(1)
{
for(i=0;j=100,i<100;++i)
while(j--)
show(i);
}
}
void show(unsigned char n)
{
P0=table[n%10];
P2=~0x01;
delay();
P2=0xFF;
P0=table[n/10];
P2=~0x02;
delay();
P2=0xFF;
}
void delay()
{
int i=100;
while(i--);
}本回答被提问者和网友采纳