代码
package test;
public class Foryunyong {
public static void main(String[] args) {
int a,b;
int c=5;
for (a = 0; a <= 6; a++) {
for (b=a;b<=c;b++){
System.out.print(' ');
}
for (b=0;b<=a;b++){
System.out.print('*');
System.out.print(' ');
}
System.out.print("
");
}
int i,j;
int d=5;
for (i = 0;i <= 6;i++) {
for (j=0; j<=i; j++){
System.out.print(' ');
}
for (j=i;j<=d;j++){
System.out.print('*');
System.out.print(' ');
}
System.out.print("
");
}
}
}