import java.util.IdentityHashMap;
public class Test01 {
//基督教门徒例题
public static void main(String[]args) {
//记录门徒的状态
int[] persons = new int[13];
//背踢掉人数的计数器
int personCount = 0;
//数三计数器
int count3 = 0;
//下标计数器
int i = 0;
//当被踢掉的人数小于等于12,如果等于12就结束;
while (personCount <=persons.length - 1) {
//当人还没有被踢掉计数
if (persons[i] <= 12) {
count3++;
//当数三计数器数到3.踢掉当前门徒
if (count3 == 3) {
//踢掉
persons[i] = 1;
//踢掉人数计数器加1
personCount++;
//数3计数归0,重新数
count3 = 0;
}
}
//下标加一
i++;
//下标越界后,重置0,循环遍历
// i % = personCount.length;
if (i == persons.length) {
i = 0;
}
}
for (int j = 0; j < persons.length; j++) {
// if (persons[j] == 0) {
System.out.println(j + ": " + persons[j]);
// break;
// }
}
}
}