/*
* Copyright (c) 2013, 烟台大学计算机学院
* All rights reserved.
* 作 者: 沈远宏
* 完成日期:2013 年10月22日
* 版 本 号:v1.0
* 问题描述:星号图
*/#include <iostream>
using namespace std;
int main()
{
int i,j,f,h;
for (i=0;i<6;++i)
{
for (j=0;j<5-i;++j)
{
cout<<" ";
}
for (f=0;f<2*i+1;++f)
{
cout<<"*";
}
for (h=0;h<5-i;++h)
{
cout<<" ";
}
cout<<endl;
}
cout<<endl;
return 0;
}
运行结果: