1483下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0
#include <reg52.h> #include <intrins.h> #define uchar unsigned char #define uint unsigned int //共阳极数码管段码 uchar code SEG7[]={/*0,1,2,3,4,5,6,7,8,9,*/0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,}; //开始-投票剩余--同意-不同意 uchar bzgan;//开始 uchar zong=8;//投票剩余 uchar yes; //同意 uchar no; //不同意 uchar num[4]; //数码管位码端口 sbit w1=P2^0; sbit w2=P2^1; sbit w3=P2^2; sbit w4=P2^3; sbit s1=P1^0; sbit s2=P1^1; sbit s3=P1^2; sbit s4=P1^3; //延时函数ms void delayms(uint t) { uint i,j; for(i=0;i<t;i++) for(j=0;j<120;j++); } //数码管显示 void dis() { //停止 if(bzgan==0) {