break和continue

package step4;

public class HelloWorld {

    public static void main(String[] args) {

        int i = 0;

        while(i <= 20){

            i++;

            if(    i%2==0  ){

                System.out.println( i + "是偶数");

                }

            else{

                System.out.println(i + "是奇数");

                }

            if(i==13){

                break;

            }

        }

    }

}

上一篇:Go语言基础之流程控制for循环


下一篇:累加数