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中的匿名对象

    匿名对象就是没有明确给出名字的对象.一般匿名对象只使用一次,而且匿名对象只在堆内存中开辟空间,而不存在栈内存的引用. 一个普通的常量字符串就可以表示一个匿名String对象. 比如可以 int len ...

  2. 【转】NGUI创建UIRoot后报NullReferenceException的解决办法

    本文参考自 http://forum.china.unity3d.com/thread-1099-1-1.html 使用NGUI版本3.7.5. 在创建了一个UIRoot后,有时会报NullRefer ...

  3. GZip压缩的js文件IE6下面不能包含<script>标签

    IE6下面,GZip压缩的js文件,如果js中包含<script>标签,一遇到这样的标签,后面的内容居然都截断了,狂晕! 花了我一个晚上来找原因.. 需要将字符串'<script&g ...

  4. TWICImage.SaveToStream内存泄漏的解决办法

    这个BUG从2010到XE5一直没改.....只能自己写个函数来搞了 uses ActiveX; procedure WICImageSaveToStream(AWICImage: TWICImage ...

  5. awk统计nginx日志访问前一百的ip

    访问ip  awk '{print $1}' access.log| sort | uniq -c | sort -n -k 1 -r | head -n 100 访问地址 awk '{print $ ...

  6. Largest Number || LeetCode

    #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 1000 int cm ...

  7. npm的使用

    npm的用途: 用官方的包 用其他人的包 传自己的包给别人用 一: 安装 1.用别人的: npm install argv 这样下载好之后,argv包就放在了工程目录下的node_modules目录中 ...

  8. Windows Runtime - 面向对象化的C++(并非意味着托管)

    Windows 8的开发平台总体上分为两部分:一是全新的WinRT,界面搭配Metro style,二是传统的Win32..NET(SL).IE三大平台,界面为传统窗体风格.其中全新的WinRT被微软 ...

  9. JQuery 可见性过滤选择器

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  10. charles工具的使用

    charles工具使用 charles除了之前介绍过模拟弱网的功能外,还有很多强大的功能.最近客户端测试用到的功能介绍如下: 一.准备工作 1.手机设置代理 charles设置代理端口号8888:Pr ...