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 ...
随机推荐
- 关于更新Ubuntu14.04内核后,virtualbox无法开机vm的问题
virtualbox和linux内核结合比较紧密,所以当内核意外改动,可能会引起virtualbox无法启动虚拟机,只要尝试启动虚拟机,就会弹出让你执行/etc/init.d/vboxdrv setu ...
- ForkJoin框架
1. 什么是Fork/Join框架 Fork/Join框架是Java7提供了的一个用于并行执行任务的框架, 是一个把大任务分割成若干个小任务,最终汇总每个小任务结果后得到大任务结果的框架. 我们再通过 ...
- PostgreSQL Replication之第十三章 使用PL/Proxy扩展(2)
13.2 设置 PL/Proxy 简短的理论介绍之后,我们可以继续前进并运行一些简单的PL/Proxy设置.要做到这一点,我们只需安装PL/Proxy并看看这是如何被使用的. 安装PL/Proxy是一 ...
- [原创] 分享一些linux教程
书<鸟哥的linux私房菜第三版>,链接:http://pan.baidu.com/s/1i3femnr 配套视频,链接:http://pan.baidu.com/s/1v72xw --- ...
- paper 49:论文退稿?审稿人帮你总结了22个能避免的常见问题
很多投稿出去的文章都是可上可下的.往往退稿的时候,审稿人提了一堆意见,说退稿.但是大家想过没有?如果能事先预测到这些意见,或者请懂行的人事先看过文章预测出意见,然后根据这些意见修改好了再投出去,说不定 ...
- Linux centOS7 下安装mysql5.7.10
1:下载二进制安装包 http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz 2:解压到 ...
- linux中启动与终止lnmp的脚本
说是lnmp, 其实暂时只是 lnp, 因为还没有安装 mysql 这是脚本: #!/bin/bash function lnmpstart() { nginx /usr/local/php/bin/ ...
- 典型的检查对float精度理解的代码
-rand()%); vy = ); vz = ); pList_particle[i].m_velocity = Vector3(vx,vy,vz); ... 1,3行代码的vx和vz的值域可以通过 ...
- SSAS中角色(Role)定义需要注意的两个地方
开发过SSAS Cube的朋友应该都知道,我们可以在SSAS中设置若干个角色,把windows账号放入这些角色中来限制不同的windows账号可以看到的数据有哪些,这里有两点需要注意一下. 首先在Cu ...
- string与char之间的互相转换
string对象是一种很强大的存在哈~~ 1. string转const char* string s = "abc"; const char* c_s = s.c_str(); ...