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] Hint Not 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 ...
随机推荐
- linux bash history
vim /etc/profile export HISTSIZE=10000 export HISTTIMEFORMAT="`whoami` : %F %T : " export ...
- tomcat下jndi配置
jndi(Java Naming and Directory Interface,Java命名和目录接口)是一组在Java应用中访问命名和目录服务的API.命名服务将名称和对象联系起来,使得我们可以用 ...
- 实现 DIV 固定定位在网页主体部分最右侧
position:fixed 相对于窗口的固定定位,这个窗口可理解为可视窗口,除了浏览器自己的东西,剩下的就是这个可视窗口.而大部分的网页都是窄屏设计,比如说网页主体部分固定宽 1200px,或者自适 ...
- java程序员从笨鸟到菜鸟之(七)一—java数据库操作
本文来自:曹胜欢博客专栏.转载请注明出处:http://blog.csdn.net/csh624366188 数据库访问几乎每一个稍微成型的程序都要用到的知识,怎么高效的访问数据库也是我们学习的一个 ...
- iOS8中用UIVisualEffectView实现高斯模糊视图(毛玻璃效果)
UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *vi ...
- java 获取当前系统系时间
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 SimpleDateFo ...
- new XMLHttpRequest()和页面关系
1. 三个页面分别对应"自己“的异步对象(3个) <title></title> <script type="text/javascript&quo ...
- [转]Eclipse Java注释模板设置详解
原文链接:http://blog.csdn.net/ahhsxy/archive/2009/09/11/4542682.aspx 设置注释模板的入口: Window->Preference-&g ...
- 分享Centos作为WEB服务器的防火墙规则
# Firewall configuration written by system-config-firewall # Manual customization of this file is no ...
- 《OpenGL着色语言》理解点记录三
“帧缓冲区”中的“帧”的含义? “帧”是连续图像中的一幅,3D可视化程序最终都是转化为一幅幅的图像输出在显示器上,这一幅幅的图像叫做叫“帧”. 解释“glBlendFunc(GL_SRC_AL ...