#include "reg52.h"
typedef unsigned int u16;

sbit k1 = P3^1; //定义P31口是k1
sbit led = P2^0; //定义P20口是led

void main(){
while(1){
if(k1 == 0){
led = 0;
}
else{
led = 1;
}
}
}