您的位置:首页 > 其它

第9周项目3-输出星号图(f)

2014-10-23 16:07 134 查看
/* 
*Copyright (c) 2014,烟台大学计算机学院 
*All rights reserved. 
*文件名称:Annpion.cpp 
*作者:王耀鹏 
*完成日期:2014年10月23日 
*版本号:v1.0 
* 
*问题描述:输出星号图 
*输入描述:不输入 
*程序输出:输出星号图 
*/  
#include<iostream>
using namespace std;
int main()
{
	int i,t,s,x,y,z;
	for (i=1;i<=6;i++)
	{
		for (t=1;t<=(6-i);t++)
		{
			cout<<" ";
		}
		for (s=1;s<=(2*i-1);s++)
		{
			cout<<"*";
		}
		cout<<endl;
	}
	for (x=1;x<=5;x++)
	{
		for (y=1;y<=x;y++)
		{
			cout<<" ";
		}
		for (z=1;z<=(11-2*x);z++)
		{
			cout<<"*";
		}
		cout<<endl;
	}
	return 0;
}

运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: