w*******e 发帖数: 395 | 1 bool cancall() {
static int array[1000]={0};
static int totCnt;
static int lastTime;
static int index;
if(getTime()-lastTime<1) {
lastTime = getTime();
if(totCnt>=N) return false;
array[index]++;
totCnt++;
return true;
}
else {
lastTime = getTime();
index = (index+1)%1000;
totCnt -= array[index];
array[index] = 1;
totCnt++;
return true;
}
}
if you need improve the g... 阅读全帖 |
|