【HUSTOJ】1055: 字符图形11-字母正三角
2016-05-05 21:12
218 查看
1055: 字符图形11-字母正三角
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 43 Solved: 33
原题链接
Description
输入一个整数打印字符图形
Input
一个整数(0<N<10)
Output
一个字符图形
Sample Input
4
Sample Output
A ABC ABCDE ABCDEFG
HINT
Source
#include<iostream> using namespace std; main() { int N; char ch='A'; cin>>N; for(int i=0;i<N;i++) { for(int j=0;j<N-i-1;j++) {cout<<' ';} for(int k=0,ch='A';k<2*i+1;k++,ch++) {cout<<(char)ch;} cout<<endl; } }
相关文章推荐
- 大数据学习笔记3-近邻搜索
- SPOJ HIGH (生成树计数)
- Android----ObjectAnimator and ValueAnimator
- 第十周项目—阅读程序,写出执行结果(2)
- 定时器
- CRF(条件随机场)
- 在tomcat上全手工部署Servlet3.0
- 【前端】screenX/Y, clientX/Y, pageX/Y 的区别
- LeetCode-10. Regular Expression Matching
- NYOJ-183赚钱啦,bellman//spfa水过,,题还是蛮变态的赶脚~~
- 关于View.getHeight和getWidth为0的解决方案(待深入学习)
- 原型模式(Prototype)以及深浅复制
- 快速排序复习
- Hadoop2.4.1伪分布式搭建
- leetcode_097 Interleaving String
- 详解mysql int数字类型的长度值大小上限
- Spring的反射工具类 ReflectionUtils
- 地图处理之基本使用汇总
- 要读的论文
- 关于堆栈的一些认识