A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 贾晓军 中级黑马   /  2015-4-18 00:15  /  1143 人查看  /  8 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

class  CatDemo
{
        public static void main(String[] args)
        {
                int x=0;
                if (x<10)
                {
                        while (x==0)
                        {
                                System.out.println("      *             *");
                                x++;
                            continue;
                        }
                        while (x==1)
                        {
                                System.out.println("   *     *      *      * ");
                                x++;
                                continue;
                        }
                        while (x==2)
                        {
                                System.out.println("  *          *           *");
                                x++;
                                continue;
                        }
                        while (x==3)
                        {
                                System.out.println(" *     *            *     *");
                                x++;
                                continue;
                        }
                        while (x==4)
                        {
                                System.out.println(" *    ***          ***    *");
                                x++;
                                continue;
                        }
                        while (x==5)
                        {
                                System.out.println(" *           *            *");
                                x++;
                                continue;
                        }
                        while (x==6)
                        {
                                System.out.println("  *                      *");
                                x++;
                                continue;
                        }
                        while (x==7)
                        {
                                System.out.println("   *       *****       *");
                                x++;
                                continue;
                        }
                        while (x==8)
                        {
                                System.out.println("     *       *       *");
                                x++;
                                continue;
                        }
                        while (x==9)
                        {
                                System.out.println("         *   *   * ");
                                x++;
                                continue;
                        }

                }
        }
}

QQ截图20150418001421.png (1.16 KB, 下载次数: 37)

QQ截图20150418001421.png

8 个回复

倒序浏览
同桌好,赞一个      
回复 使用道具 举报
哈哈  为了黑马币啊
回复 使用道具 举报

:lol


回复 使用道具 举报
回复 使用道具 举报
好闲 哈哈哈
回复 使用道具 举报
东升神起 来自手机 中级黑马 2015-4-22 19:54:59
7#
666          真会玩
回复 使用道具 举报
666                  
回复 使用道具 举报
好帅帅的想法    顶
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马