[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] |
|