public class Count3Qiut {
public static void main(String args[]){
boolean[] boo = new boolean[500];
for(int i=0;i<boo.length;i++){
boo[i] = true;
}
int count = 0;
int index = 0;
int booLength = 500; //表示true的个数
while(booLength > 1){
if(boo[index] == true){
count++;
if(count == 3){
count = 0;
boo[index] = false;
booLength--;
}
}
index++;
if(index == boo.length){
index = 0;
}
}
for(int i =0;i<boo.length;i++){
if(boo[i]){
System.out.println(i);
}
}
}
}
java 数三退一
最新推荐文章于 2021-02-26 23:17:04 发布