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. 投票ajax请求代码(点赞代码)

    function vote(url, arr) { jq.ajax({ cache: false, async: false, url: url, type: 'post', data: {info_ ...

  2. hibernate 多对多双向关联

    package com.bjsxt.hibernate; import java.util.HashSet; import java.util.Set; import javax.persistenc ...

  3. .NET Remoting与Socket、Webservice和WCF的比较及优势 (转)

    1:Socket VS Remoting 使用socket无疑是效率最高的.但是,在复杂的接口环境下,Socket的开发效率也是最低的.故在兼顾开发效率的情况下,可以使用Remoting来代替Sock ...

  4. ssh2 三大框架整合

    提示:eclipse环境.工程环境.tomcat环境的jdk保持一致 1.新建一个工程,把工程的编码为utf-8 2.把jsp的编码形式改成utf-8 3.把jar包放入到lib下           ...

  5. 【Shiro】Apache Shiro架构之自定义realm

    [Shiro]Apache Shiro架构之身份认证(Authentication) [Shiro]Apache Shiro架构之权限认证(Authorization) [Shiro]Apache S ...

  6. HTML5学习笔记1 HTML5 新元素

    自1999年以后html4.0已经改变了很我,今天,在html4.01中的几个已经被废弃,这些元素在html5中已经被删除或重新定义. 为了更好地处理今天的互联网应用,html5添加了很多新元素及功能 ...

  7. bootstrap 学习笔记 轮播(Carousel)插件

    Bootstrap轮播(carousel)插件是一种灵活的响应式的向站点添加滑块的方式.除些之外,内容也是足够灵活的,可以是图像,内嵌框架,视频或者其他您想要旋转的任何类型的内容. 示例: 下面是不念 ...

  8. php创建对象。真!变!态!

    PHP创建类的方式,真是够变态,以下是创建方式: 假设类: class SomeClass {//....} 创建对象: 1.直接通过类名实例化 $obj1 = new SomeClass(); 这种 ...

  9. 从构建分布式秒杀系统聊聊验证码 给大家推荐8个SpringBoot精选项目

    前言 为了拦截大部分请求,秒杀案例前端引入了验证码.淘宝上很多人吐槽,等输入完秒杀活动结束了,对,结束了...... 当然了,验证码的真正作用是,有效拦截刷单操作,让羊毛党空手而归. 验证码 那么到底 ...

  10. ExtJS学习------Ext.define的继承extend,用javascript实现相似Ext的继承

    (1)Ext.define的继承extend 详细实例: Ext.onReady(function(){ //Sup Class 父类 Ext.define('Person',{ config:{ n ...