HDU 4706 Children's Day(模拟啊)
2014-11-23 20:11
369 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4706
Problem Description
Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesand one diagonal. Each pixel of this letter is a character orderly. No tail blank is allowed.
For example, this is a big 'N' start with 'a' and it's size is 3.
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').
Input
This problem has no input.
Output
Output different 'N' from size 3 to size 10. There is no blank line among output.
Sample Output
Source
2013 ACM/ICPC Asia Regional Online —— Warmup
代码如下:
打表代码如下:
Problem Description
Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesand one diagonal. Each pixel of this letter is a character orderly. No tail blank is allowed.
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').
Input
This problem has no input.
Output
Output different 'N' from size 3 to size 10. There is no blank line among output.
Sample Output
[pre]
a e bdf c gh 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.
Source
2013 ACM/ICPC Asia Regional Online —— Warmup
代码如下:
#include <cstdio> const int maxn = 117; int main() { char s[maxn][maxn]; int i, j, k; int cont = 0; for(i = 3; i <= 10; i++) { for(j = 0; j < i; j++) //全部赋值为空格 { for(k = 0;k < i;k++) s[j][k] = ' '; } for(j = 0; j < i; j++)//第一列 { s[j][0] = 'a' + cont; cont = (cont+1)%26; } for(j = i-2; j > 0; j--)//副对角线 { s[j][i-j-1] = 'a' + cont; cont = (cont+1)%26; } for(j = 0; j < i; j++)//最后一列 { s[j][i-1] = 'a' + cont; cont = (cont+1)%26; } for(j = 0;j < i;j++) printf("%s\n",s[j]); } return 0; }
打表代码如下:
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; char ff(char c) { if(c > 'z') c = 'a'; return c; } int main() { int i, j, k, l; char c = 'a'; printf("a e\nbdf\nc g\n"); printf("h n\ni mo\njl p\nk q\n"); printf("r z\ns ya\nt x b\nuw c\nv d\n"); printf("e o\nf np\ng m q\nh l r\nik s\nj t\n"); printf("u g\nv fh\nw e i\nx d j\ny c k\nzb l\na m\n"); printf("n b\no ac\np z d\nq y e\nr x f\ns w g\ntv h\nu i\n"); printf("j z\nk ya\nl x b\nm w c\nn v d\no u e\np t f\nqs g\nr h\n"); printf("i a\nj zb\nk y c\nl x d\nm w e\nn v f\no u g\np t h\nqs i\nr j\n"); return 0; }
相关文章推荐
- HDU-#4706 Children's Day(模拟)
- HDU4706——Children's Day(简单模拟)
- HDU 4706 Children's Day(模拟)
- hdu 4706 (是暴力?还是愚蠢?)Children's Day
- hdu 4706 Children's Day
- hdu 4706 Children's Day 2013年ICPC热身赛A题 模拟
- HDU 4706 Children's Day(模拟)
- hdu 5641 King's Phone 模拟
- HDU 4706 Children's Day(简单模拟)
- HDU 1103.Flo's Restaurant【模拟】【3月2】
- HDU 4119 Isabella's Message(模拟)
- hdu 5640 King's Cake(模拟)
- hdu 4119 Isabella's Message(模拟)
- hdu 4119 Isabella's Message(模拟+字典树)
- hdu 4119 Isabella's Message ( 模拟 )
- HDU 1009 FatMouse' Trade (模拟)
- HDU---Children's queue(递归解法)
- HDU-5186-zhx's submissions(Java+简单模拟)
- hdu 4706 Children's Day 2013年ICPC热身赛A题 模拟
- hdu 1098 Ignatius's puzzle