/*
*文件名称:Ex4-1.cpp
*作 者:彭俊荣
*完成日期:2017年4月19日
*版 本 号:v1.0
*对任务及求解方法的描述部分:编写循环结构程序,输出星号
*输入描述:无
*问题描述:运用for语句编写循环程序
*程序输出:星号组成的特定图形
*问题分析:无
*算法设计:无
*/
#include <iostream>
using namespace std;
int main()
{
int i,j;
for(j=1;j<=6-1;++j)
cout<<" ";
cout<<"*"<<endl;
for(i=2;i<=6-1;++i)
{
for(j=1;j<=6-i;++j)
cout<<" ";
cout<<"*";
for(j=1;j<=2*i-3;++j)
cout<<" ";
cout<<"*"<<endl;
}
for(j=1;j<=2*6-1;++j)
cout<<"*";
cout<<endl;
return 0;
}