*
**
***
****
*****
public static void main(String[] args)
{
for (int x=0; x<5 ; x++)
{
for (int y=0; y<=x ; y++)
{
System.out.print("*");
}
System.out.println();
}
1
12
123
1234
12345
for (int x=1; x<6; x++)
{
for (int y=1;y<=x ; y++)
{
System.out.print(y);
}
System.out.println();
}
//99乘法表
for (int x=1;x<10 ;x++ )
{
for (int y=1;y<=x ;y++ )
{
System.out.print(x+"*"+y+"="+x*y+" ");
}
System.out.println();
}
*
* *
* * *
* * * *
* * * * *
for (int x=0;x<5 ; x++)
{
for (int y=x;y<4 ;y++ )
{
System.out.print(" ");
}
for (int z=0;z<=x; z++)
{
System.out.print("* ");
}
System.out.println();
}
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
for (int x=0;x<5 ; x++)
{
for (int y=x;y<4 ;y++ )
{
System.out.print(" ");
}
for (int z=0;z<=x; z++)
{
System.out.print("* ");
}
System.out.println();
}
for (int x=0;x<4 ;x++ )
{
for (int y=0;y<=x; y++)
{
System.out.print(" ");
}
for (int z=4;z>x ;z-- )
{
System.out.print("* ");
}
System.out.println();
}