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. static、final修饰符、内部类

    static修饰符: static修饰符能够与属性.方法和内部类一起使用,表示静态的.类中的静态变量和静态方法能够与类名一起使用.不须要创建一个类的对象来訪问该类的静态成员. class Static ...

  2. MVC 强类型传值Model。和弱类型传值ViewData[&quot;&quot;]。及用EF进行增删查改(母版页的使用)

    <1> 控制器 </pre><pre name="code" class="csharp">using MvcTest.Mo ...

  3. Spring入门示例

    开发环境 Spring 4.3.0+Myeclipse2015+JDK1.8 准备阶段: 1.新建一Spring01项目,然后新建一个lib文件.将下面的添加到lib文件中 2.将lib文件所有的包导 ...

  4. O2O研究系列——O2O知识思维导图整理

    本篇文章对O2O电子商务模式的常规知识点,使用思维导图的方式整理,表达的形式是名词纲领性的方式, 不会在图中详细说明各个点. 通过这个图研究O2O模式时,可以系统的对各个业务点进行更深入的研究,避免有 ...

  5. 工作总结 .ToString("000000")

    ; ");//000123 指定格式 Console.WriteLine(ssp); ; ");//123456789 超过了返回原值 Console.WriteLine(ss);

  6. python selenium--常用函数1

    新建实例driver = webdriver.Chrome() 1.通过标签属性Id查找元素 方法:find_element_by_id(element_id) 实例:driver.find_elem ...

  7. mongodb - 查看正在执行的操作

    查看正在执行的操作 db.currentOp() 查看系统执行的操作 db.currentOp(True) kill正在执行的操作 db.killOp(<operation id>) 示例 ...

  8. C++设计模式之适配器模式(三)

    4.适配器模式总结 在对象适配器模式中.适配器与适配者之间是关联关系:在类适配器模式中.适配器与适配者之间是继承关系.不论是对象适配器还是类适配器.适配器模式都将现有接口转化为客户类所期望的接口.实现 ...

  9. Hive 文件格式

    hive文件存储格式包括以下几类: 1.TEXTFILE 2.SEQUENCEFILE 3.RCFILE 4.ORCFILE(0.11以后出现) 其中TEXTFILE为默认格式,建表时不指定默认为这个 ...

  10. redis源码学习_整数集合

    redis里面的整数集合保存的都是整数,有int_16.int_32和int_64这3种类型,和C++中的set容器差不多. 同时具备如下特点: 1.set里面的数不重复,均为唯一. 2.set里面的 ...