第11周项目1(2)-printchs函数的调用(输出星号图)
来源:互联网 发布:股指期货实时数据接口 编辑:程序博客网 时间:2024/06/04 20:13
/*
*Copyright (c) 2014 ,烟台大学计算机学院
*All right reserved.
*文件名称:printchs函数的调用(输出星号图).cpp
*作 者:王伟诚
*完成日期:2014年11月06日
*版 本 号:1.0
*
*问题描述:printchs函数的调用(输出星号图)*问题输入:M$pszi$y
*问题输出:输出星号图
*/
#include <iostream>using namespace std;void printchs(int a, char b){ int m; for(m=1;m<=a;m++) cout<<b;}int main(){ int n=6; int i; for(i=1;i<=n;++i) { printchs(n-i,' '); printchs(2*i-1,'*'); cout<<endl; } return 0;}
变式:
#include <iostream>using namespace std;void printchs(int a, char b){ int m; for(m=1;m<=a;m++) cout<<b;}int main(){ int n=7; int i; for(i=1;i<=n;++i) { printchs(n-i,' '); printchs(2*i-1,65+i-1); cout<<endl; } return 0;}
挺好玩!!
0 0
- 第11周项目1(2)-printchs函数的调用(输出星号图)
- 第11周项目1 函数版星号图(2printchs函数的调用)
- 第11周项目1-函数版星号图(2)调用printchs函数
- 第11周项目1-2调用函数printchs输出星号图
- 第11周项目1-4用printchs函数输出学过的星号图
- 第11周项目1(2)-函数版星号图(printchs)
- 调用函数printchs输出星号图(2)
- 第十一周 项目一(2)调用函数printchs输出星号
- 调用函数printchs输出星号图
- 调用函数printchs输出星号图
- 调用函数printchs输出星号图。
- 调用函数printchs输出星号图
- 第11周项目1-函数版星号图(4)输出以前的星号
- 第11周项目1:调用函数输出星号图
- 第11周函数的定义与调用项目1 调用函数输出星号图
- 第11周项目一--调用函数输出星号图(2)
- 第11周项目一--调用函数输出星号图(1)
- 第11周项目1函数版星号图(1填充程序输出星号图)
- 第十一周项目一--函数版型号图
- java对byte,short,char,int,long运算时自动类型转化情况说明
- 第十一周项目1——函数版星号图
- 第11周项目1-函数版星号图(3)
- 浅谈Linux内核和CPU架构
- 第11周项目1(2)-printchs函数的调用(输出星号图)
- SlidinfMenu的
- 第十一周 项目一 调用函数输出星号图
- oracle 同时更新(update)多个字段多个值
- 第十一周项目二:求最大公约数
- 函数指针数组
- ORACLE 软件下载及补丁
- LeetCode刷题笔录Largest Rectangle in Histogram
- ListView多选操作模式详解CHOICE_MODE_MULTIPLE与CHOICE_MODE_MULTIPLE_MODAL