20.输出图形

*

**

***

****

*****

****

***

**

*

 

#include<iostream>
using namespace std;

int main()
{
    for(int i=1;i<=5;i++)
    {
        for(int j=1;j<=i;j++)
        {
            cout<<"*";
        }
        cout<<endl;
    }
    for(int m=4;m>=0;m--)
    {
        for(int n=1;n<=m;n++)
        {
            cout<<"*";
        }
        cout<<endl;
    }
    return 0;
}

 

posted on 2014-08-06 11:48  Ji_xiaowu  阅读(115)  评论(0编辑  收藏  举报

导航