hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup
2015-04-29 20:06
489 查看
http://acm.hdu.edu.cn/showproblem.php?pid=4706
Memory Limit: 32768/32768 K (Java/Others)
[align=left]Problem Description[/align]
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').
[align=left]Input[/align]
This problem has no input.
[align=left]Output[/align]
Output different 'N' from size 3 to size 10. There is no blank line among output.
[align=left]Sample Output[/align]
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.
[align=left]Source[/align]
2013 ACM/ICPC Asia Regional Online —— Warmup
分析:
输出由字符组成的‘N’ , 三到十的大小。(模拟一下就可以啦)
AC代码:
View Code
Children's Day
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
[align=left]Problem Description[/align]
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').
[align=left]Input[/align]
This problem has no input.
[align=left]Output[/align]
Output different 'N' from size 3 to size 10. There is no blank line among output.
[align=left]Sample Output[/align]
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.
[align=left]Source[/align]
2013 ACM/ICPC Asia Regional Online —— Warmup
分析:
输出由字符组成的‘N’ , 三到十的大小。(模拟一下就可以啦)
AC代码:
#include<cstdio> #include<cstring> using namespace std; char map[15][15]; int main() { int k = 0; for(int n = 3;n <= 10;n++) { //memset(map,'\n',sizeof(map)); for(int i = 0;i <= n;i++) { for(int j = 0;j < n;j++) { if(i == 0 || i == n - 1 || i + j == n - 1) { map[j][i] = k % 26 + 'a'; k++; } else if(i == n) { map[j][i] = '\0'; } else map[j][i] = ' '; } } for(int i = 0;i < n;i++) printf("%s\n",map[i]); } return 0; }
View Code
相关文章推荐
- HDU 4706 Children's Day && 2013 ACM/ICPC Asia Regional Online —— Warmup
- HDU 4710 Balls Rearrangement && 2013 ACM/ICPC Asia Regional Online —— Warmup
- HDU 4707 Pet && 2013 ACM/ICPC Asia Regional Online —— Warmup
- hduoj 4715 Difference Between Primes 2013 ACM/ICPC Asia Regional Online —— Warmup
- hduoj 4708 Rotation Lock Puzzle 2013 ACM/ICPC Asia Regional Online —— Warmup
- hduoj 4710 Balls Rearrangement 2013 ACM/ICPC Asia Regional Online —— Warmup
- hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup
- HDU 4714 Tree2cycle 求树的分叉数 && 2013 ACM/ICPC Asia Regional Online —— Warmup
- HDU 4708 Rotation Lock Puzzle && 2013 ACM/ICPC Asia Regional Online —— Warmup
- hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup
- HDU 4715 Difference Between Primes && 2013 ACM/ICPC Asia Regional Online —— Warmup
- 2013 ACM/ICPC Asia Regional Changchun Online Problem J & hdu4768 Flyer(二分)
- 2013 ACM/ICPC Asia Regional Online — Warmup 个人总结
- HDU 4714 Tree2cycle(树状DP)(2013 ACM/ICPC Asia Regional Online ―― Warmup)
- hduoj 4707 Pet 2013 ACM/ICPC Asia Regional Online —— Warmup
- 2013 ACM-ICPC长沙赛区全国邀请赛So Easy! && 2015 ACM/ICPC Asia Regional Shenyang Online-Best Solver
- hdu4707 Pet 2013 ACM/ICPC Asia Regional Online —— Warmup
- 2013 ACM/ICPC Asia Regional Online —— Warmup
- 2013 ACM/ICPC Asia Regional Online —— Warmup简单题题解
- 2013 ACM/ICPC Asia Regional Online —— Warmup 1002