第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; }
运行结果:
知识点总结:自定义函数的运用
学习心得:自定义函数要与主函数相对应,并且思路清晰
相关文章推荐
- 第11周项目1-函数版星号图(3)
- 第11周项目1(2)-函数版星号图(printchs)
- 第11周项目1-函数版星号图
- 第11周项目1-函数版星号图(1)
- 第11周项目一 函数版星号图(3)
- 第11周上机实践项目1——函数版星号图
- 第11周项目1(1)-函数版星号图
- 第11周项目1 函数版星号图3
- 第11周项目1(2)-函数版星号图
- 第11周项目1函数版星号图(1填充程序输出星号图)
- 第11周项目1函数版星号图(2&review)
- 第11周项目1函数版星号图(1)
- 第11周项目一 函数版星号图(2)
- 第11周项目1-函数版星号图(3)输出字母三角形
- 第11周项目1函数版星号图(1)
- 第11周 项目1 函数版星号图(1)(4)
- 第11周项目1-函数版星号图(1)
- 第11周项目一 函数版星号图(4)
- 第11周项目1 函数版星号图(2printchs函数的调用)
- 第11周项目1 函数版星号图1