#include
#define uchar unsigned char
#define uint unsigned int
uchar code tab[] ={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,
0x82,0xf8,0x80,0x90,0xff}; //0,12,3,4,5,6,7,8,9,关显示
uchar b,d,t; //定义变量
uchar fen=10,miao=0; //定时初始时间变量
uchar flag; //标志位
uchar temp; //矩形键盘键值
sbit beep =P1^7 ; //蜂鸣器
void delay(uint z) //延时函数
{
uint x,y;
for(x=z;x>0;x--)
for( y= 110;y>0;y--);
}
void dispaly() //定时时间显示
{
uchar miaoge,fenge,miaoshi,fenshi;
miaoge = miao%10;
P2 = 0x80;;
P0 =tab[miaoge];
delay(1);
miaoshi = miao/10;
P2 =0x40;
P0 =tab[miaoshi];
delay(1);
fenge = fen%10;
P2=0x20;
P0 =tab[fenge];
delay(1);
fenshi =fen/10;
P2 =0x10;
P0 =tab[fenshi];
delay(1);
P2 =0x00;
}
void dispaly1(char a) //甲队比分显示
{
uchar ge1,shi1;
b=a;
ge1=b%10;
P2=0x02;
P0=tab[ge1];
delay(1);
shi1=b/10;
P2=0x01;
P0=tab[shi1];
delay(1);
P2=0x00;
}
void dispaly2(char c) //乙队比分显示
{
uc