总结:不满足条件时,输出当前====
package com.b; import java.util.Scanner; //用continue写出偶数的代码是: public class twe { public static void main(String[] args) { Scanner c = new Scanner(System.in); System.out.println("请输入===="); int a = c.nextInt(); for (int i = 0; i < a; i++) { if (i % 2 != 0) continue;// 碰到奇数不输出,继续循环,不满足条件即遇到偶数,直接输出 i System.out.println(i); } } } // 请输入==== 10 0 2 4 6 8