http://acm.hdu.edu.cn/showproblem.php?pid=4706

Children's Day

Time Limit: 2000/1000 MS (Java/Others) 

   Memory Limit: 32768/32768 K (Java/Others)

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  m o
j l  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

分析:

输出由字符组成的‘N’  , 三到十的大小。(模拟一下就可以啦)

AC代码:

 #include<cstdio>
#include<cstring>
using namespace std;
char map[][];
int main() {
int k = ;
for(int n = ;n <= ;n++) { //memset(map,'\n',sizeof(map));
for(int i = ;i <= n;i++) {
for(int j = ;j < n;j++) {
if(i == || i == n - || i + j == n - ) {
map[j][i] = k % + 'a';
k++;
} else if(i == n) {
map[j][i] = '\0';
} else map[j][i] = ' ';
}
} for(int i = ;i < n;i++)
printf("%s\n",map[i]);
}
return ;
}

hduoj 4706 Children&#39;s Day 2013 ACM/ICPC Asia Regional Online —— Warmup的更多相关文章

  1. hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup

    hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...

  2. hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Other ...

  3. hduoj 4710 Balls Rearrangement 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4710 Balls Rearrangement Time Limit: 6000/3000 MS (Java/Ot ...

  4. hduoj 4708 Rotation Lock Puzzle 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4708 Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/O ...

  5. hduoj 4715 Difference Between Primes 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4715 Difference Between Primes Time Limit: 2000/1000 MS (J ...

  6. hduoj 4707 Pet 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4707 Pet Time Limit: 4000/2000 MS (Java/Others)    Memory ...

  7. 2013 ACM/ICPC Asia Regional Online —— Warmup

    1003 Rotation Lock Puzzle 找出每一圈中的最大值即可 代码如下: #include<iostream> #include<stdio.h> #inclu ...

  8. HDU 4714 Tree2cycle(树状DP)(2013 ACM/ICPC Asia Regional Online ―― Warmup)

    Description A tree with N nodes and N-1 edges is given. To connect or disconnect one edge, we need 1 ...

  9. HDU 4749 Parade Show 2013 ACM/ICPC Asia Regional Nanjing Online

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4749 题目大意:给一个原序列N,再给出一个序列M,问从N中一共可以找出多少个长度为m的序列,序列中的数 ...

随机推荐

  1. java中重载和覆盖(又称重写)的区别

    初次见到这两个单词并没有什么特别的感觉,但是时间长了,却发现书上一会儿用override,一会儿又用overload,搞得我的迷迷糊.于是就做了个总结,希望能对和我一样对这两个概念模糊不清的网友有一个 ...

  2. 搭建C语言开发环境

    大学的时候有数据结构这门课,但...终究还是得学.电脑是win8的,根据网上的教程倒是能安装成功vc6.0并且能够打开新建工程,但是一编译运行就提示兼容性问题. 首先安装C语言编译器.下载MinGw ...

  3. win7 创建软链接方式

    mklink  目标文件  源文件(需要被软链的文件) Win7中的软链接详解(mklink命令) Post by 铁木箱子 in 技术杂谈 on 2011-05-24 13:13. 点评一下 评论 ...

  4. 面向对象与面向过程 $this的注意事项和魔术方法set和get

    一.面向对象与面向过程的区别: 二者都是一种思想,面向对象是相对于面向过程而言的.面向过程,强调的是功能行为.面向对象,将功能封装进对象,强调具备了功能的对象.面向对象更加强调运用人类在日常的思维逻辑 ...

  5. jdk1.7的collections.sort(List list)排序问题

    1.7使用旧排序: System.setProperty("java.util.Arrays.useLegacyMergeSort", "true"); 1.7 ...

  6. alibaba的FastJson(高性能JSON开发包)

    这是关于FastJson的一个使用Demo,在Java环境下验证的 class User{ private int id; private String name; public int getId( ...

  7. LINQ to SQL系列四 使用inner join,outer join

    先看一个最简单的inner join,在读取Student表时inner join Class表取的对应的Class信息: static void Main(string[] args) { usin ...

  8. JS事件分析

    1.注册事件 1.1 使用HTML元素的事件属性 <div id='myDiv' style="width:100px;height:100px;background-color:re ...

  9. 如何将XML文件写入数据库

    将xml文件转成string public string XMLDocumentToString(XmlDocument doc) { MemoryStream stream = new Memory ...

  10. iOS 获取UUID

    -(NSString*)GetUUID { CFUUIDRef puuid = CFUUIDCreate( nil ); CFStringRef uuidString = CFUUIDCreateSt ...