码迷,mamicode.com
首页 > 其他好文 > 详细

双for循环

时间:2018-08-03 00:59:23      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:div   ++   color   ring   class   code   ati   nbsp   oid   

public class Dome1{
    public static void main (String []args){
        for(int i=1;i<=5;i++){
                for(int j=1;j<=5-i;j++){
            System.out.print(" ");        
        }
            for(int j=1;j<=2*i-1;j++){
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("------------------");
    }
}

 

双for循环

标签:div   ++   color   ring   class   code   ati   nbsp   oid   

原文地址:https://www.cnblogs.com/jingcaibin/p/9410672.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!