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

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 蓝枫 中级黑马   /  2014-4-3 15:04  /  728 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

[code】
@@@@@
@@@@
@@@
@@
@
class Demo
{
        public static void main(String[] args)
        {
           for(int x = 0;x<5;x++)
                {
                        for(int y = x;y<5;y++)
                        {
                                System.out.print("@");
                        }
                        System.out.println();
            }
        }
}







@
@@
@@@
@@@@
@@@@@
class Demo
{
        public static void main(String[] args)
        {
           for(int x = 0;x<5;x++)
                {
                        for(int y = 0;y<x+1;y++)
                        {
                                System.out.print("@");
                        }
                        System.out.println();
            }
        }
}








@@@@@
@@@@@
@@@@@
@@@@@
@@@@@
class Demo
{
        public static void main(String[] args)
        {
                for(int x = 0;x<5;x++)
                {
                        for(int y = 0;y<5;y++)
                        {
                                System.out.print("@");
                        }
                        System.out.println();
                }
        }
}








123456
12345
1234
123
12
1
class Demo
{
        public static void main(String[] args)
        {
                for(int x=6; x>=1; x--)
                {
                        for(int y = 1;y<=x;y++)
                        {
                                System.out.print(y);
                        }
                        System.out.println();
                }
        }
}









1
12
123
1234
12345
123456
class Demo
{
        public static void main(String[] args)
        {
                for(int x=1; x<=6; x++)
                {
                        for(int y = 1;y<=x;y++)
                        {
                                System.out.print(y);
                        }
                        System.out.println();
                }
        }
}








九九乘法表
class Demo
{
        public static void main(String[] args)
        {
                for(int x = 1;x<=9;x++)
                {
                        for(int y = 1;y<=x;y++)
                        {
                                System.out.print(y+"*"+x+"="+y*x+"\t");
                        }
                        System.out.println();
                }
        }
}









    *
   * *
  * * *
* * * *
* * * * *
class Demo
{
        public static void main(String[] args)
        {
                for(int x= 0;x<5;x++)
                {
                        for(int y =x;y<5;y++)
                        {
                                System.out.print(" ");
                        }
                        for(int z = 0;z<=x;z++)
                        {
                                System.out.print("* ");
                        }
                        System.out.println();
                }
        }
}[/code]

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马