Children's Day

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 648    Accepted Submission(s): 422

Problem Description
Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesand one diagonal. Each pixel of this letter is a character orderly. No tail blank is allowed.
For example, this is a big 'N' start with 'a' and it's size is 3.

a e
bdf
c g

Your task is to write different 'N' from size 3 to size 10. The pixel character used is from 'a' to 'z' continuously and periodic('a' is reused after 'z').

 
Input
This problem has no input.
 
Output
Output different 'N' from size 3 to size 10. There is no blank line among output.
 
Sample Output
a e
bdf
c g
h n
i mo
jl p
k q
.........
r j
Hint

Not all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.

 
Source
 
Recommend
liuyiding   |   We have carefully selected several similar problems for you:  4822 4821 4820 4819 4818 

  
  模拟题
  模拟输出大写字母‘N’,‘N’由小写字母组成,输出的尺寸大小由3增加到10,每个尺寸之间没有空格。输出示例见上。
  做这样的模拟题就是要观察输出图形之间的数学关系。总结出关系之后,图形输出就很容易了。
  代码:
 
 #include <iostream>

 using namespace std;

 int main()
{
int n; //size
int c = ; //该尺寸的第一个字母的序号
for(n=;n<=;n++){ //循环尺寸
int i,j; //该尺寸的第i行,和该行第j个元素
int c1=c%,c2=(c+*n-)%; //分别记录每一行的第一个字母和最后一个字母序号
if(c1==) c1=;
if(c2==) c2=;
for(i=;i<=n;i++){ //行
int k=n+-i; //每一行中间元素的位置
for(j=;j<=n;j++){ //该行每一个元素
if(j==)
cout<<char(c1+'a'-);
else if(j==n)
cout<<char(c2+'a'-);
else if(j==k){ //中间元素
int kc = (c+n+k-)%;
if(kc==) kc=;
cout<<char(kc+'a'-);
}
else
cout<<' ';
}
cout<<endl;
c1=(c1+)%,c2=(c2+)%;
if(c1==) c1=;
if(c2==) c2=;
}
c=(c+*n-)%;
if(c==)
c=;
}
return ;
}

Freecode : www.cnblogs.com/yym2013

hdu 4706:Children's Day(模拟题,模拟输出大写字母 N)的更多相关文章

  1. hdu 4706 Children's Day 2013年ICPC热身赛A题 模拟

    题意:按字母顺序排列成n型,简单的模拟题. 当字母排到z时从a开始重新排起. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: ...

  2. HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011亚洲北京赛区网络赛)

    HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 ...

  3. HDU 4452 Running Rabbits (模拟题)

    题意: 有两只兔子,一只在左上角,一只在右上角,两只兔子有自己的移动速度(每小时),和初始移动方向. 现在有3种可能让他们转向:撞墙:移动过程中撞墙,掉头走未完成的路. 相碰: 两只兔子在K点整(即处 ...

  4. HDU 2414 Chessboard Dance(模拟题,仅此纪念我的堕落)

    题目 模拟题也各种wa,我最近真的堕落了,,,,,智商越来越为负数了!!!!!!!! #include<stdio.h> #include<string.h> #include ...

  5. hdu 4706 Children's Day(模拟)

    http://acm.hdu.edu.cn/showproblem.php?pid=4706 [题目大意]: 用a-z排出N的形状,输出大小为3-10的N,如果超过z之后,重新从a开始 下面是大小为3 ...

  6. HDU 4706 Children's Day(简单模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4706 题目大意:要用‘a’-‘z’ 26个小写字母输出倒着写得字母'N'的形状,例如 a ebdfc ...

  7. HDU 4706 Children's Day (水题)

    Children's Day Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  8. hdu 4119 Isabella's Message 模拟题

    Isabella's Message Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.p ...

  9. HDU 4925 Apple Tree(模拟题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4925 解题报告:给你n*m的土地,现在对每一块土地有两种操作,最多只能在每块土地上进行两种操作,第一种 ...

随机推荐

  1. Spring之替换Bean的返回结果,替换Bean的方法实例

    Spring是一个非常强悍的框架+容器,其中有代理模式(动态代理模式)的极致体现.下面是两个比较让人感觉精彩的代码使用,重点关注main方法中的ClassPathXMlApplicationConte ...

  2. thinkphp 表名 大小写 窍门

    我们有一个表auth_group_access,那么如何使用呢?在使用M方法时,对于带下划线的表名,可以采用如下方法. M('AuthGroupAccess');对应sql语句SQL: SHOW CO ...

  3. 改动Dialog窗口的类名

     VS2013 的MFC project(project名: MobileLink).想要改动窗口的类名时,发现不是像设置窗口名一样调用一个函数能够实现的. 实现的注意问题,请看凝视. (1) 改 ...

  4. 算法笔记_058:蓝桥杯练习 2的次幂表示(Java)

    目录 1 问题描述 2 解决方案   1 问题描述 问题描述 任何一个正整数都可以用2进制表示,例如:137的2进制表示为10001001. 将这种2进制表示写成2的次幂的和的形式,令次幂高的排在前面 ...

  5. 关于bitmap recycle trying to use a recycled bitmap android.graphics.Bitmap

    在开发中,一直使用4.0以上手机作为測试机所以一直没有出现这个问题,今天换了2.3版本号的手机.出现了这个错误: trying to use a recycled bitmap android.gra ...

  6. user-defined conversion

    http://en.cppreference.com/w/cpp/language/cast_operator

  7. js取消radio选中 反选

    var radio=document.createElement("input");radio.type="radio";radio.onclick = fun ...

  8. 解决 TextMate 2 无法安装 Emmet 插件

    本篇文章由:http://xinpure.com/solving-textmate-2-cannot-install-emmet-plugin/ 前端神器 Emmet 插件原名为 ZedCoding ...

  9. ftp客户端的创建

    1.本段代码采用了 select I/O端口复用 2.含有三种功能:ls,  上传文件, 下载文件.这是拷贝别人的代码,自己添加了注释,随后会进行修改, 自己需要的功能:上传文件, 下载文件,  (并 ...

  10. CSDN开源夏令营 百度数据可视化实践 ECharts(8)

    (1)前言 首先谢谢林峰老师,继续接着第七篇提到的内容.CSS布局确实非常累,感觉不好看了就的调整,总的看起来的高大上嘛.好了废话不再多说.今天主要就先解说一个页面的内容,对于CSS布局后面讲会具体的 ...