假设全局变量为flag
if(flag == 2 && count==0){
return;
}
if(count<10){
flag=1;
count++;
}else{
flag=2;
count--