题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4706

题目大意:要用‘a’-‘z’ 26个小写字母输出倒着写得字母'N'的形状,例如 

a e
bdf
c g

就是大小为3的N。输出大小为3-10的所有N的形状,a-z的使用是连续并且周期循环的。

Sample Output
a e
bdf
c g
h n
i mo
jl p
k q
.........
r j

代码如下:

 # include<iostream>
# include<cstdio>
using namespace std; int main()
{
int i,j,k;
int ans = ;
for(i=; i<=; i++)
{
for(j=; j<=i; j++)
{
printf("%c",ans+'a');
for(k=; k<=i-j-; k++)
printf(" ");
if(j!= && j!=i)
printf("%c",(ans+*(i-j))%+'a');
for(k=; k<=j-; k++)
printf(" ");
printf("%c",(ans+*i-)%+'a');
ans ++;
ans %= ;
printf("\n");
}
ans += i+i-;
ans %= ;
// printf("\n");
}
return ;
}

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(模拟题,模拟输出大写字母 N)

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

  3. 【HDU 4452 Running Rabbits】简单模拟

    两只兔子Tom和Jerry在一个n*n的格子区域跑,分别起始于(1,1)和(n,n),有各自的速度speed(格/小时).初始方向dir(E.N.W.S)和左转周期turn(小时/次). 各自每小时往 ...

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

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

  5. hdu 1200 To and Fro(简单模拟或DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1200 To and Fro Time Limit: 2000/1000 MS (Java/Others ...

  6. hdu 4414 Finding crosses【简单模拟】

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=4414 CSUST:点击打开链接 Finding crosses Time Limit: 2000/1000 ...

  7. HDU 4706:Children's Day

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

  8. HDU 5268 ZYB loves Score (简单模拟,水)

    题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include &l ...

  9. HDU 5059 Help him(简单模拟题)

    http://acm.hdu.edu.cn/showproblem.php?pid=5059 题目大意: 给定一个字符串,如果这个字符串是一个整数,并且这个整数在[a,b]的范围之内(包括a,b),那 ...

随机推荐

  1. grep环境变量常用配置

    vim ~/.bashrc GREP_OPTIONS="-irns --exclude-dir=output --exclude=tags --exclude=*.files" 然 ...

  2. redis ltrim命令

    LTRIM key start stop 相关命令 BLPOP BRPOP BRPOPLPUSH LINDEX LINSERT LLEN LPOP LPUSH LPUSHX LRANGE LREM L ...

  3. POJ3349: Snowflake Snow Snowflakes(hash 表)

    考察hash表: 每一个雪花都有各自的6个arm值,如果两个雪花从相同或者不同位置开始顺时针数或者逆时针数可以匹配上,那么这两个雪花就是相等的. 我们采用hash的方法,这样每次查询用时为O(1),总 ...

  4. hdoj 2612 Find a way【bfs+队列】

    Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. windows下svn+apache搭建svn服务器

    使用软件: apache_2.0.55-win32-x86-no_ssl.msi Setup-Subversion-1.5.3.msi TortoiseSVN-1.5.10.16879-win32-s ...

  6. poj1873 The Fortified Forest 凸包+枚举 水题

    /* poj1873 The Fortified Forest 凸包+枚举 水题 用小树林的木头给小树林围一个围墙 每棵树都有价值 求消耗价值最低的做法,输出被砍伐的树的编号和剩余的木料 若砍伐价值相 ...

  7. eclipse安装maven插件

  8. 通过WMI配置IP

    $wmi = gwmi win32_networkadapterconfiguration -filter "ipenabled = 'true'"$wmi.EnableStati ...

  9. android 读取用户号码,手机串号,SIM卡序列号

    简介: IMSI:international mobiles subscriber identity国际移动用户号码标识,这个一般大家是不知道,GSM必须写在卡内相关文件中:MSISDN:mobile ...

  10. Dreamweaver中清除php代码中多余空行的方法

    使用DW自带的搜索功能,利用正则表达式 使用正则表达式搜索:\r\n\s*\r\n即可搜到代码中的空行,再用回车符\n替换即可消除代码中的多余空行