求c++大神

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 00:22:57

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