问题及代码:
/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称:ss.cpp
*作者:李盈盈
*完成日期:2014年10月24日
*版本号:v1.0
*
*问题描述:输出星号图
*程序输出:漂亮的星号图
*/
#include <iostream>
using namespace std;
int main()
{
int i,j;
for (i=0; i<6; i++)
{
for (j=0; j<11-2*i; j++)
cout<<"*";
cout<<endl;
}
cout<<endl;
return 0;
}
运行结果: