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) 

   Memory Limit: 32768/32768 K (Java/Others)

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 bdfc 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

a e

bdf

c g

h    n

i  m o

j l  p

k    q

.........

r    j

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

分析:

输出由字符组成的‘N’  , 三到十的大小。(模拟一下就可以啦)

AC代码:

 1 #include<cstdio>
 2 #include<cstring>
 3 using namespace std;
 4 char map[15][15];
 5 int main() {
 6     int k = 0;
 7     for(int n = 3;n <= 10;n++) {
 8
 9         //memset(map,‘\n‘,sizeof(map));
10         for(int i = 0;i <= n;i++) {
11             for(int j = 0;j < n;j++) {
12                 if(i == 0 || i == n - 1 || i + j == n - 1) {
13                     map[j][i] = k % 26 + ‘a‘;
14                     k++;
15                 } else if(i == n) {
16                     map[j][i] = ‘\0‘;
17                 } else map[j][i] = ‘ ‘;
18             }
19         }
20
21         for(int i = 0;i < n;i++)
22             printf("%s\n",map[i]);
23     }
24     return 0;
25 }

hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup

时间: 2024-10-12 16:59:32

hduoj 4706 Children&#39;s Day 2013 ACM/ICPC Asia Regional Online —— Warmup的相关文章

hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup

hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2005    Accepted Submission(s): 563 Problem Description Little Joh

hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup

http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 1610    Accepted Submission(s): 630 Problem Description (From wikipedia) For bina

hduoj 4708 Rotation Lock Puzzle 2013 ACM/ICPC Asia Regional Online —— Warmup

http://acm.hdu.edu.cn/showproblem.php?pid=4708 Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Alice was felling into a cave. She found a strange door with a number square m

hduoj 4707 Pet 2013 ACM/ICPC Asia Regional Online —— Warmup

http://acm.hdu.edu.cn/showproblem.php?pid=4707 Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in th

hduoj 4710 Balls Rearrangement 2013 ACM/ICPC Asia Regional Online —— Warmup

http://acm.hdu.edu.cn/showproblem.php?pid=4710 Balls Rearrangement Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 735    Accepted Submission(s): 305 Problem Description Bob has N balls and A b

2013 ACM/ICPC Asia Regional Chengdu Online

题目链接: 2013 ACM/ICPC Asia Regional Chengdu Online 上年网选被虐得好惨,遂决定把题目拿回来搞一遍, 不会的题补之! A. 2013 ACM/ICPC Asia Regional Chengdu Online,布布扣,bubuko.com

hdu 4751 Divide Groups bfs (2013 ACM/ICPC Asia Regional Nanjing Online 1004)

SDUST的训练赛 当时死磕这个水题3个小时,也无心去搞其他的 按照题意,转换成无向图,预处理去掉单向的边,然后判断剩下的图能否构成两个无向完全图(ps一个完全图也行或是一个完全图+一个孤点) 代码是赛后看的网上大神,所以转载过来了,dfs染色的时候很巧妙,巧妙的用到了就两个无向完全图 #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <qu

hdu 5868 2016 ACM/ICPC Asia Regional Dalian Online 1001 (burnside引理 polya定理)

Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 208    Accepted Submission(s): 101 Problem Description You may not know this but it's a fact that Xinghai Square is

2016 ACM/ICPC Asia Regional Shenyang Online 1007/HDU 5898 数位dp

odd-even number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 388    Accepted Submission(s): 212 Problem Description For a number,if the length of continuous odd digits is even and the length