求大神批下此程序是不是对的《0到60秒倒计时》
#include<reg51.h>#define uint unsigned int
#define uchar unsigned char uchar table{}={0x3f,0x06,0x5b,0x4f,0x66,0x6D,0x7D,0x7f,0x6f}
uint time;
void display(){
wei1=0x01;
P0=~table[time%10];
delay_ms(2);
wei2=0x02;
P0=~table[time/10];
delay_ms(2);
Void main(){
TMOD=0x02;
TLO=0x06;
THO=0x06;
EA=1; ETO=1;
TRO=1;
time=59;
n=2000;
while(1){
display();
}
}
voidtime0() interrupt 1(n++;
if(n--==0){
time--;
if(time==0)time=60;
n=2000;
}