初步实现代码:

#include<iostream>
#include<iomanip>
using namespace std;
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
cout<<setw(7-i);
for(j=1;j<=2*i-1;j++)
cout<<'*';
cout<<endl;
}
}

运行结果如图:

编程打印输出*金字塔

题型变换为输入行数,然后出现金字塔形状

相关文章:

  • 2021-12-13
  • 2021-11-18
  • 2021-12-04
  • 2021-12-05
  • 2021-11-17
  • 2021-10-17
  • 2021-10-10
  • 2021-11-28
猜你喜欢
  • 2018-12-03
  • 2020-07-17
  • 2021-11-23
  • 2021-10-12
  • 2021-11-17
  • 2021-12-03
  • 2021-10-12
  • 2021-11-18
相关资源
相似解决方案