#$
来源:互联网 发布:mysql分页加排序语句 编辑:程序博客网 时间:2024/06/15 19:03
代码:
#include <iostream>using namespace std;//在下面写printchs函数的定义,功能是输出一行若干个指定字符void printchs(int m,char ch){ for(int j=1;j<=m;++j) cout<<ch;}int main( ){ int n=6; //n代表要输出的行数 int i; //通过在下面的循环里调用printchs函数,输出右面的图 for(i=1; i<=n; ++i) { printchs(n-i,'#'); printchs(2*i-1,'$') ; printchs(6-i,'#'); cout<<endl; } return 0;}
运行结果:
0 0
- 程序员
- 程序员?
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 值得关注和学习的java开源项目
- 第十一周项目一:函数版星号图(3)
- 数据修改- INSERT
- iOS8.0 之后UIAlertView和UIActionSheet的创建方式的新变化
- 代码自定义UITableViewCell
- #$
- IDirect3DDevice9::Clear函数
- Virgin Brazilian HairSimply put,
- HTML5之Canvas
- 第11周项目1 函数版星号图(2printchs函数的调用)
- XCode6新建项目中pch文件,及strings文件处理
- 职业规划提示
- XPath语法 在C#中使用XPath示例
- C#实验十1.3