一个简单的java编程,50个小孩手拉手 每次报数到7时,踢出一个小孩最后踢出的小孩是第几个小孩?

帮我改改下面的程序吧 谢谢!! public class child { public static void main(String[] args) { int[] child =new int[50]; int i ; int falg = 1; for(i=0;i
匿名用户    2010-09-20 20:31    

满意回答

public class Count3Quit1 { public static void main(String[] args) { boolean[] b = new boolean; for(int i=0;i1) { if(b==true) { counter++; if(counter==7) { counter=0; b=false; leftCount--; } } index++; if(index==b.length) { index=0; } } for(int i=0;i

匿名用户   2010-09-20 20:34
宝宝知道提示您:回答为网友贡献,仅供参考。

为您推荐:

其他回答

也可以用循环链表做

匿名用户    2010-09-25 10:18

这就是约瑟夫环问题

匿名用户    2010-09-24 16:08

可以参考马士兵的视频

匿名用户    2010-09-23 09:08