用for循环计算1到1000之间的奇数 用for循环计算1到1000之间的奇数 用for循环计算1到1000之间的奇数 用for循环计算1到1000之间的奇数 System.out.println("帮忙啊!");
收起
public class Test { /** * @param args * @throws InterruptedException */ public static void main(String[] args) { for (int i = 0; i < 1000; i++) { if (i % 2 != 0) { // 奇数 System.out.println(i); } if (i % 2 == 0) { // 偶数 System.out.println(i); } } } }
报告相同问题?