JAVA 练习题

[复制链接]
查看11 | 回复1 | 2009-8-20 10:27:40 | 显示全部楼层 |阅读模式
有n个人围成一圈,顺序排号.n = 500, m= 3public class Count3Quit1 {public static void main(String[] args) {
boolean[] b = new boolean[500];
for(int i=0;i1) {
if(b[index]==true) {
counter++;
if(counter==3) {
counter=0;
b[index]=false;
leftCount--;
}
}
index++;
if(index==b.length) {
index=0;
}
} for(int i=0;i list = new ArrayList();for (int i = 0; iend = new HashSet();int count = 10000;String str;char ch;for (int i = 1; i0; i -= 2) { for (int j = 1; j0) {
if (temp > maxCount) {
maxCount = temp;
maxDay = i;
} }}System.out.println(maxDay); }}
回复

使用道具 举报

千问 | 2009-8-20 10:27:40 | 显示全部楼层
辛苦了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行