import java.util.ArrayList;
public class Demo14 {
/**
* @param args
*/
public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<>();
for (int i = 1; i <= 100; i++) {
list.add(i);
}
int count = 0;
for (int i = 0; list.size() > 1; i++) {
count++;
if (i == list.size()) {
i = 0;
}
if (count == 14) {
list.remove(i--);
count = 0;
}
}
System.out.println(list.get(0));
}
}
|