pp6.7 stars/a

来源:互联网 发布:速卖通数据分析 编辑:程序博客网 时间:2024/04/30 02:38

package qsy;

public class stars1
{

 public static void main(String[] args)
 {
  int row,star;final int MAX_ROWS=10;
   row=1;
  while(row<=MAX_ROWS)
  {star=10;
    while(star>=row)
    
    {System.out.print("*"); 
     star--;}
   
    System.out.println() ;
    row++;
  }
 }
}

 

//注意star=10得写在while循环里面,否则不能每次初始化为10!!!
0 0
原创粉丝点击