int n = 17;
boolean[] persons = new boolean[n];
//初始化
for(int i=0;i<persons.length;i++){
persons[i] = true;
}
int len = persons.length;//剩下的人数
int count = 0;
while(len>1){
//继续报数
for(int i=0;i<persons.length;i++){
if(persons[i]){
count++;
if(count == 3){
persons[i] = false;
count = 0;
len--;
}
}
}
}