class ArrayTest2
{
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();
}
int b =5;
for (int x=0; x<5; x++)
{
for (int y=0; y<=x; y++)
{
System.out.print(" ");
}
for (int z=0; z<b; z++)
{
System.out.print("* ");
}
b--;
System.out.println();
}
}
}
看着有点乱 我也是新手 看着视频教程自己写的 大神会有更简单的 |