求c++大神
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/28 10:34:59
![求c++大神](/uploads/image/z/11146338-18-8.jpg?t=%E6%B1%82c%2B%2B%E5%A4%A7%E7%A5%9E)
求c++大神
求c++大神
求c++大神
代码:
#include<iostream>
using namespace std;
int main()
{
for(int i=0; i<7; i++)
{
if(i<=3)
for(int j=0; j<2*i+1; j++)
cout<<"* ";
else
for(int j=0; j<2*(6-i)+1; j++)
cout<<"* ";
cout<<endl;
}
return 0;
}
测试结果: