求c++大神

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/19 19:56:28

求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;
}
测试结果: