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

【题目大意】:

  用a-z排出N的形状,输出大小为3-10的N,如果超过z之后,重新从a开始

下面是大小为3的N(其实这里的N是反的,呵呵)

a e
bdf
c g

大小为4的N
h  n
i mo
jl p
k  q

【code】:

  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. using namespace std;
  6.  
  7. char str[][][];
  8. int cnt;
  9.  
  10. void solve(int id)
  11. {
  12. int n=id,i;
  13. for(i=;i<n;i++)
  14. {
  15. str[id][i][]=cnt%+'a';
  16. cnt++;
  17. }
  18. for(i=n-;i>;i--)
  19. {
  20. str[id][i][n-i-]=cnt%+'a';
  21. cnt++;
  22. }
  23. for(i=;i<n;i++)
  24. {
  25. str[id][i][n-]=cnt%+'a';
  26. cnt++;
  27. }
  28. }
  29.  
  30. void print()
  31. {
  32. int i,j,k;
  33. for(i=;i<=;i++)
  34. {
  35. for(j=;j<i;j++)
  36. {
  37. for(k=;k<i;k++)
  38. {
  39. if(str[i][j][k]>='a'&&str[i][j][k]<='z') putchar(str[i][j][k]);
  40. else putchar(' ');
  41. }
  42. putchar();
  43. }
  44. }
  45. }
  46.  
  47. int main()
  48. {
  49. int i,j,k;
  50. cnt=;
  51. memset(str,,sizeof(str));
  52. for(i=;i<=;i++)
  53. {
  54. solve(i);
  55. }
  56. print();
  57. return ;
  58. }

hdu 4706 Children's Day(模拟)的更多相关文章

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

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

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

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

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

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

  4. HDU 4706:Children's Day

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

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

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

  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. HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011亚洲北京赛区网络赛)

    HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 ...

  8. HDU 5948 Thickest Burger 【模拟】 (2016ACM/ICPC亚洲区沈阳站)

    Thickest Burger Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  9. HDU 5920 Ugly Problem 【模拟】 (2016中国大学生程序设计竞赛(长春))

    Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

随机推荐

  1. Nginx - HTTP Configuration, Module Variables

    The HTTP Core module introduces a large set of variables that you can use within the value of direct ...

  2. 【AngularJs】---"Error: [ng:areq] Argument 'fn' is not a function, got undefined"

    项目中把controller.service抽取出来 一步一步没有报错 index那里加 <script src="js/controllers/XXController.js&quo ...

  3. oracle中比较两表表结构差异和数据差异的方法

    在工作中需要完成这么一个需求:比较两个表的表结构是否形相同,并找出差异.比较两个表中的数据是否相同,并找出差异数据?    分析:由于表结构中字段比较多,手工比较很浪费时间,而且不能保证不出错误.对于 ...

  4. AIDL实现Android IPC

    1.AIDL文本解释 在软件工程中,接口定义语言(IDL)已经成为通用术语,是用来描述软件组件接口的特定语言.在Android中,该IDL被称为Android接口定义语言(AIDL),它是纯文本文件, ...

  5. 【Cocos2d入门教程六】Cocos2d-x事件篇之触摸

    Cocos游戏当中产生一个事件时,可以有多个对象在监听该事件,所以有优先级(Priority).优先级越高(Priority值越小),事件响应越靠前. 关系图: 新 事件分发机制:在2.x 版本事件处 ...

  6. Unity3D项目实战笔记(10):Unity3D编译IPA的PostEvents–节约时间利器

    最近,SDK支付等接入差不多了,就从Unity3D生成IPA (企业版License), 然,需要手动执行的PostEvents竟然多大10项+, 这些我默默的承受了1周时间,每次约浪费20分钟-额外 ...

  7. 百练_2945 拦截导弹(DP)

    描述 某国为了防御敌国的导弹袭击,开发出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度.某天,雷达捕捉到敌国的导弹来袭 ...

  8. template_1

    0: 模板是一些为多种类型而编写的函数和类,而且这些类型都没有指定.当使用模板的时候,只需要把所希望的类型作为一个(显示或隐示的)实参传递给模板.模板是语言本身所具有的特效,她完全支持类型检查和作用域 ...

  9. .NET常用网络资源收藏

    .NET核心站点: Microsoft主页 https://www.microsoft.com ASP.NET主页 http://www.asp.net TechNet中文网 https://tech ...

  10. myeclipse与数据库进行连接(无需写代码进行验证)

    首先对SqlServer配置管理器进行设置. 1.打开SqlServer配置管理器 2.进入SQL配置管理器后,选中左侧“SQL Server网络配置”>>再选中“MSSQLSERVER的 ...