Children's Day

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 1733    Accepted Submission(s): 1121

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.

  1. a e
  2. bdf
  3. 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
  1. [pre]
  2. a e
  3. bdf
  4. c g
  5. h n
  6. i mo
  7. jl p
  8. k q
  9. .........
  10. r j
  11. [/pre]
  12. Hint
  13. Not all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.
  14.  
 

迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……

  1. #include <iostream>
  2. #include <cmath>
  3. #include <stdio.h>
  4. #include <string>
  5. #include <cstring>
  6. #include <map>
  7. #include <set>
  8. #include <vector>
  9. #include <stack>
  10. #include <queue>
  11. #include <iomanip>
  12. #include <algorithm>
  13. using namespace std;
  14. char mp[20][20];
  15. char nextc(char c)
  16. {
  17. if(c=='z')return 'a';
  18. else return ++c;
  19. }
  20. int main()
  21. {
  22. char cur='a';
  23. int i,j,k;
  24. for(i=3; i<=10; i++)
  25. {
  26. memset(mp,' ',sizeof(mp));
  27. for(j=0; j<i; j++)
  28. {
  29. mp[j][0]=cur;
  30. cur=nextc(cur);
  31. }
  32. for(j=i-2,k=1; j>0; j--,k++)
  33. {
  34. mp[j][k]=cur;
  35. cur=nextc(cur);
  36. }
  37. for(j=0; j<i; j++)
  38. {
  39. mp[j][i-1]=cur;
  40. cur=nextc(cur);
  41. }
  42. for(j=0; j<i; j++)
  43. {
  44. for(k=0; k<i; k++)
  45. printf("%c",mp[j][k]);
  46. printf("\n");
  47. }
  48. }
  49. return 0;
  50. }

HDU 4706:Children's Day的更多相关文章

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

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

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

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

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

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

  4. hdu 4706:Children's Day(模拟题,模拟输出大写字母 N)

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

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

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

  6. hduoj 4706 Children&#39;s Day 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4706 Children's Day Time Limit: 2000/1000 MS (Java/Others) ...

  7. HDOJ/HDU 1297 Children’s Queue(推导~大数)

    Problem Description There are many students in PHT School. One day, the headmaster whose name is Pig ...

  8. HDU 1297 Children’s Queue (递推、大数相加)

    Children’s Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. hdu 4706

    注意一点 空的地方打空格而不是空字符,我因为这wa了一次... #include<cstdio> #include<cstring> #include<cstdlib&g ...

随机推荐

  1. linux bash history

    vim /etc/profile export HISTSIZE=10000 export HISTTIMEFORMAT="`whoami` : %F %T : " export ...

  2. tomcat下jndi配置

    jndi(Java Naming and Directory Interface,Java命名和目录接口)是一组在Java应用中访问命名和目录服务的API.命名服务将名称和对象联系起来,使得我们可以用 ...

  3. 实现 DIV 固定定位在网页主体部分最右侧

    position:fixed 相对于窗口的固定定位,这个窗口可理解为可视窗口,除了浏览器自己的东西,剩下的就是这个可视窗口.而大部分的网页都是窄屏设计,比如说网页主体部分固定宽 1200px,或者自适 ...

  4. java程序员从笨鸟到菜鸟之(七)一—java数据库操作

     本文来自:曹胜欢博客专栏.转载请注明出处:http://blog.csdn.net/csh624366188 数据库访问几乎每一个稍微成型的程序都要用到的知识,怎么高效的访问数据库也是我们学习的一个 ...

  5. iOS8中用UIVisualEffectView实现高斯模糊视图(毛玻璃效果)

    UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *vi ...

  6. java 获取当前系统系时间

    //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 SimpleDateFo ...

  7. new XMLHttpRequest()和页面关系

    1.  三个页面分别对应"自己“的异步对象(3个) <title></title> <script type="text/javascript&quo ...

  8. [转]Eclipse Java注释模板设置详解

    原文链接:http://blog.csdn.net/ahhsxy/archive/2009/09/11/4542682.aspx 设置注释模板的入口: Window->Preference-&g ...

  9. 分享Centos作为WEB服务器的防火墙规则

    # Firewall configuration written by system-config-firewall # Manual customization of this file is no ...

  10. 《OpenGL着色语言》理解点记录三

    “帧缓冲区”中的“帧”的含义?   “帧”是连续图像中的一幅,3D可视化程序最终都是转化为一幅幅的图像输出在显示器上,这一幅幅的图像叫做叫“帧”.   解释“glBlendFunc(GL_SRC_AL ...