您的位置:首页 > 其它

第11周项目1函数星号图(2)

2014-11-06 14:53 225 查看
/*。
*Copyright(c)2014,烟台大学计算机学院
*All right reserved,
*文件名:test.cpp
*作者:biyutang
*完成日期:2014年11月6日
*版本号:v1.0
*
问题描述:
*输入描述:输入x
*程序输出:输出Y
*/
#include <iostream>

using namespace std;
void printchs(int m,char f)
{
for(int j=0;j<m;j++)
cout<<f;
}
int main()
{
int n=6,i;
for(i=1;i<=n;i++)
{
printchs(n-i,' ');
printchs(2*i-1,'*');
cout<<endl;
}
return 0;
}


运行结果:



知识点总结:自定义函数的运用

学习心得:自定义函数要与主函数相对应,并且思路清晰
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: