//画菱形 for(int hs=0; hs<10; hs++) { for(int a=hs;a<10; a++ ){ System.out.print(" "); } for ( int ls=1; ls<=hs ; ls++) { System.out.print("* "); } System.out.println(); } for(int hs1=10; hs1>0; hs1--) { for(int b=hs1; b<10; b++ ){ System.out.print(" ");} for ( int ls=1; ls<=hs1 ; ls++) { System.out.print("* "); } System.out.println(); } }
for(int hs=1;hs<11; hs++) { for(int kg=9; kg >=hs; kg--) { System.out.print(" "); } for ( int ds=1; ds<=hs; ds++) { System.out.print("* "); } System.out.println(); } for (int hs1=9; hs1>0; hs1--) { for(int kg=9; kg >=hs1; kg--) { System.out.print(" "); } for ( int ds=1; ds<=hs1; ds++) { System.out.print("* "); } System.out.println(); } }