天天看点

break与continue

public static void main(String[] args) {
    //定义一个for循环
    for(int a = 1 ; a<=100 ; a++){
        //如果a/2有余数(证明他是个奇数)
        if (a%2!=0){
        //跳过本轮循环
            continue;}
            //输出本轮循环a的数字
        System.out.print(a + " ");
​
​
        //如果a能将10整除
        if(a%10==0){
            //输出一个换行
            System.out.println();
        }