java例程练习(数三退一[用数组模拟])
摘要:
public class ThreeOut { public static void main(String[] args) { boolean[] arr = new boolean[500]; for(int i = 0; i 1) { if(arr[index] == true) { countNum ++; if(countNum == 3) { countNum = 0; arr[index] = false; leftCount --; } } index ++; if(index == arr.... 阅读全文