public class OverflowLoop{ public static final int END =Integer.MAX_VALUE; public static final int START = END -100; public static void main(String[] args) { int j=0; for (int i=START;i<=END;i++){ j++; } System.out.println(j); } } int i 在最后溢出了,不过Intellij IDEA 不知道咋搞的,这个运行变成了System.in。
循环的边界溢出
最新推荐文章于 2025-04-02 19:52:33 发布