public class wu{
    public static void main(String[] args){
        for(int i=1;i<=5;i++){
        for(int j=5-i;j>0;j--){
        System.out.print(" ");
        }
        for(int k=1;k<=2*i-1;k++){
        System.out.print("*");
        }
        System.out.println("");
        }
        
   }
}

输出效果为:

     *
   ***
  *****
 *******
*********

相关文章:

  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-07-22
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 1970-01-01
  • 2021-08-06
相关资源
相似解决方案