2016/3/28 内循环

package NO02;

public class D02 {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  int a, b, c, d,x,y;
  for (a = 1; a < 5; a++) {
   for (b = 1; b < 5 - a; b++) {
    System.out.print(" ");
   }
   for (c = 0; c < a * 2 - 1; c++) {
    System.out.print("*");
   }
   System.out.println();
  }
  for(d=4;d>0;d--){
   for(x=4;x>d;x--){System.out.print(" ");}
   for(y=d*2-1;y>0;y--){System.out.print("*");}
   System.out.println();
  }
 }

}             

posted on 2016-03-28 21:23  查理布朗  阅读(80)  评论(0编辑  收藏  举报