class LengXing {
public static void main(String[] args) {
for (int a=1;a<=9;a++ ) {
for ( int b=1;b<=9-a ;b++ ) {
System.out.print(" ");
}
for ( int c=1;c<=a ;c++ ) {
if (c==1 | c==a) {
System.out.print("* ");
}else
System.out.print(" ");
}
System.out.println();
}
for (int i=1;i<=8 ;i++ ) {
for (int j=1;j<=i ;j++ ) {
System.out.print(" ");
}
for ( int k=0;k<=8-i ;k++ ) {
if (k==0|k==(8-i)) {
System.out.print("* ");
}else
System.out.print(" ");
}
System.out.println();
}
}
|
|