HDU 4706:Children's Day
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
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').
[pre]
a e
bdf
c g
h n
i mo
jl p
k q
.........
r j
[/pre]HintNot all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.
迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip>
#include <algorithm>
using namespace std;
char mp[20][20];
char nextc(char c)
{
if(c=='z')return 'a';
else return ++c;
}
int main()
{
char cur='a';
int i,j,k;
for(i=3; i<=10; i++)
{
memset(mp,' ',sizeof(mp));
for(j=0; j<i; j++)
{
mp[j][0]=cur;
cur=nextc(cur);
}
for(j=i-2,k=1; j>0; j--,k++)
{
mp[j][k]=cur;
cur=nextc(cur);
}
for(j=0; j<i; j++)
{
mp[j][i-1]=cur;
cur=nextc(cur);
}
for(j=0; j<i; j++)
{
for(k=0; k<i; k++)
printf("%c",mp[j][k]);
printf("\n");
}
}
return 0;
}
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(简单模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4706 题目大意:要用‘a’-‘z’ 26个小写字母输出倒着写得字母'N'的形状,例如 a ebdfc ...
- HDU 4706 Children's Day (水题)
Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 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 4706 Children's Day 2013年ICPC热身赛A题 模拟
题意:按字母顺序排列成n型,简单的模拟题. 当字母排到z时从a开始重新排起. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: ...
- hduoj 4706 Children'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) ...
- HDOJ/HDU 1297 Children’s Queue(推导~大数)
Problem Description There are many students in PHT School. One day, the headmaster whose name is Pig ...
- HDU 1297 Children’s Queue (递推、大数相加)
Children’s Queue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- hdu 4706
注意一点 空的地方打空格而不是空字符,我因为这wa了一次... #include<cstdio> #include<cstring> #include<cstdlib&g ...
随机推荐
- screen命令学习
我们有时需要做一些长时间的工作,比如格式化一个20T的raid磁盘,可能需要几个小时以上,如果只是执行格式化的话,由于网络不稳定,或者要下班了,还没格式化完成,关闭了ssh的窗口,命令可能就执行失败了 ...
- FB面经prepare: task schedule II
followup是tasks是无序的. 一开始是有序的,比如说1, 1, 2, 1,一定要先执行第一个task1,然后等task1恢复,再执行第2个task1,再执行task2..... follow ...
- using gulp
原 荐 gulp构建前端工程 半张一块 发布时间: 2016/07/27 16:22 阅读: 895 收藏: 4 点赞: 4 评论: 2 摘要 Gulp 是一个自动化工具,前端开发者可以使用它来处理常 ...
- sort 树 hash 排序
STL 中 sort 函数用法简介 做 ACM 题的时候,排序是一种经常要用到的操作.如果每次都自己写个冒泡之类的 O(n^2) 排序,不但程序容易超时,而且浪费宝贵的比赛时间,还很有可能写错. ST ...
- C++之路进阶——bzoj3262(陌上花开)
F.A.Qs Home Discuss ProblemSet Status Ranklist Contest ModifyUser gryz2016 Logout 捐赠本站 Notice:由于本OJ ...
- linux第10天 msg消息队列
cat /proc/sys/kernel/msgmax最大消息长度限制 cat /proc/sys/kernel/msgmnb消息队列总的字节数 cat /proc/sys/kernel/msgmni ...
- 三台CentOS 5 Linux LVS 的DR 模式http负载均衡安装步骤
Linux负载均衡软件LVS(概念篇) 一. LVS简介 LVS是Linux Virtual Server的简称,也就是Linux虚拟服务器, 是一个由章文嵩博士发起的自由软件项目,它的官方站点是ww ...
- 在C#中使用LOG4NET(winform程序
http://www.csharpwin.com/csharpspace/678.shtml 1.下载log4net (Google log4net) 2.unzip log4net 3.运行VS,新 ...
- System Hold, Fix Manager before resetting counters
程序pending http://www.askmaclean.com/archives/2011/11 http://blog.itpub.net/35489/viewspace-717132/ 1 ...
- [MacOSX]
When i run svn up in the folder, i got these error: svn: Error converting entry in directory 'XXXXX' ...