class ForForDemo2
{
public static void main(String[] args)
{
for (int x=0;x<12;x++ )
{
if(x<6)
{
for (int y=0;y<x ; y++)
{
System.out.print("*");
}
System.out.println();
}
else
{
for (int z=0;z<12-x; z++)
{
System.out.print("*");
}
System.out.println();
}
}
}
}
自己琢磨出来的
|
|