close

output:
5 7 9 11 ///////////////
10 8 6 4 ***********

以下為程式碼
loop2_01.java
class loop2_01
{
    public static void main(String[] args)
    {
        int i=3;
        int j=12;
       
        if(i>2)
        {
       
        while(i         {
            i+=2;
            System.out.print(i+" ");
        }
        System.out.println("///////////////");
        }
       
        if(j>11)
        {
        while(j>4)
        {
            j-=2;
            System.out.print(j+" ");
        }
        System.out.println("***********");
    }

    }
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 gtea0609 的頭像
    gtea0609

    綠茶的塔羅/撲克牌占卜隨筆隨記

    gtea0609 發表在 痞客邦 留言(0) 人氣()