public class Forfortest2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int x=0; x<5; x++)
{
for(int y=x; y<5; y++)//用于打印" "的for循环;
{
System.out.print(" ");
}
for (int z=0;z<=x;z++)//用于打印"* "的for循环;
{
System.out.print("* ");
}
System.out.println();//用于换行
}
}
}
这样的么? |