HDU 4706 Children's Day(简单模拟)
题目链接: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的使用是连续并且周期循环的。
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(简单模拟)的更多相关文章
- hdu 4706 Children's Day(模拟)
http://acm.hdu.edu.cn/showproblem.php?pid=4706 [题目大意]: 用a-z排出N的形状,输出大小为3-10的N,如果超过z之后,重新从a开始 下面是大小为3 ...
- hdu 4706:Children's Day(模拟题,模拟输出大写字母 N)
Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 【HDU 4452 Running Rabbits】简单模拟
两只兔子Tom和Jerry在一个n*n的格子区域跑,分别起始于(1,1)和(n,n),有各自的速度speed(格/小时).初始方向dir(E.N.W.S)和左转周期turn(小时/次). 各自每小时往 ...
- hdu 4706 Children's Day 2013年ICPC热身赛A题 模拟
题意:按字母顺序排列成n型,简单的模拟题. 当字母排到z时从a开始重新排起. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: ...
- 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 ...
- hdu 4414 Finding crosses【简单模拟】
题目:http://acm.hdu.edu.cn/showproblem.php?pid=4414 CSUST:点击打开链接 Finding crosses Time Limit: 2000/1000 ...
- HDU 4706:Children's Day
Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- HDU 5268 ZYB loves Score (简单模拟,水)
题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include &l ...
- HDU 5059 Help him(简单模拟题)
http://acm.hdu.edu.cn/showproblem.php?pid=5059 题目大意: 给定一个字符串,如果这个字符串是一个整数,并且这个整数在[a,b]的范围之内(包括a,b),那 ...
随机推荐
- test-from
title header1 hahhahjl header2 adfkljasd $$a^2$$ point 1 point 2 | table1 | table2 | | ---- | ---- | ...
- Codeforces182D - Common Divisors(KMP)
题目大意 如果把字符串a重复m次可以得到字符串b,那么我们称字符串a为字符串b的一个因子,现在给定两个字符串S1和S2,求它们的公共因子个数 题解 如果它们有公共因子,那么显然它们的最小公共因子肯定是 ...
- Configure the AD FS server for claims-based authentication -zhai zi wangluo
Applies To: Microsoft Dynamics CRM 2011, Microsoft Dynamics CRM 2013 After enabling claims-based aut ...
- freemaker分页备忘
思路:定义一个freemaker宏,接收参数.然后在freemaker页面上import这个文件,把参数传进来在server端渲染. 分页标签:pager.ftl <#-- 自定义的分页指令. ...
- 北京Uber优步司机奖励政策(2月6日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- advanced dom scripting dynamic web design techniques Part One DOM SCRIPTING IN DETAIL CHAPTER 1 DO IT RIGHT WITH BEST PRACTICES
You’re excited; your client is excited. All is well. You’ve just launched the client’s latest websit ...
- 【转】oracle创建表空间
原文:http://www.cnblogs.com/netsql/articles/1745978.html 注意点: 1.如果在PL/SQL 等工具里打开的话,直接修改下面的代码中[斜体加粗部分]执 ...
- [Webpack 2] Expose modules to dependencies with Webpack
When you have a dependency that has dependencies on global variables (like jQuery or lodash) or assu ...
- [AngularJS] angular-formly: expressionProperties
angular-formly provides a very simple API to dynamically change properties of your field (like disab ...
- Robots协议具体解释
禁止搜索引擎收录的方法(robots.txt) 一.什么是robots.txt文件? 搜索引擎通过一种程序robot(又称spider),自己主动訪问互联网上的网页并获取网页信息.您能够在您的站点中创 ...