public class demo06 {
private static final double rowOnceMaxNumber = 1000; //单次循环最大值
public static void main(String args[]) {
double s = 1001; //测试值
double countFor;
int frequency = 0;
countFor = s / rowOnceMaxNumber; //大循环次数值
for (int a = 0; a < countFor; a++) { //循环a等于0,如果a小于大循环次数值时进行循环
System.out.println(countFor);
for (int b = 0; b < rowOnceMaxNumber; b++) { //b小于单次循环值时则循环。
if (s > frequency) { //判断,数量值如果大于循环次数
frequency++;
} else {
break; //判断如果数量值无法大于循环总次数则跳出循环。
}
}
System.out.println(frequency);
}
}
}