public static void main(String[] args) { boolean[] people = new boolean[500]; for (int i = 0; i < people.length; i++) { people[i] = true; } int xiaBiao = 0; int jiShu = 0; int renShu = 500; while (renShu > 1) { if (people[xiaBiao]) { jiShu++; } if (jiShu == 3) { people[xiaBiao] = false; jiShu = 0; renShu--; } if (xiaBiao == people.length - 1) { xiaBiao = 0; } else xiaBiao++; } for (int i = 0; i < people.length; i++) { if (people[i]) System.out.println("最后一人在圈中的位置为:" + (i + 1)); } }