HDU 4706 Children's Day
来源:互联网 发布:apache cxf 配置文件 编辑:程序博客网 时间:2024/06/05 07:17
Children's Day
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 315 Accepted Submission(s): 196
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').
For example, this is a big 'N' start with 'a' and it's size is 3.
a ebdfc 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 ebdfc gh ni mojl pk q.........r j[/pre]HintNot 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
读题很重要.... 我看了半天, 输出倒数第二行虚线是什么意思... 读了半天,参反应过来,那只是省略了 一些字符...
哎... 看来还需要做做练习....
总之水题一道....
import java.io.*;import java.util.*;public class Main {public static void main(String[] args) {new Main().work();}void work() {char c = 'a';//求第一列数据for (int i = 3; i <=10; i++) {char[][] ch = new char[i][i];for (int j = 0; j < i; j++) {ch[j][0] = c;c=(char) ((c + 1));if (c > 'z')c = 'a';}//求 第二列 到 倒数第二列for (int k = i - 2, j = 1; k > 0 && j < i - 1; k--, j++) {ch[k][j] = c;c=(char) ((c + 1));if (c > 'z')c = 'a';}//求最后一列for (int j = 0; j < i; j++) {ch[j][i - 1] = c;c=(char) ((c + 1));if (c > 'z')c = 'a';}//输出for (int j = 0; j < i; j++) {for (int k = 0; k < i; k++) {if (ch[j][k] >= 'a' && ch[j][k] <= 'z')System.out.print(ch[j][k]);elseSystem.out.print(" ");}System.out.println();}}}}
- hdu 4706 Children's Day
- hdu 4706 Children's Day
- Hdu 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children\'s Day
- hdu 4706 Children's Day
- HDU 4706:Children's Day
- hdu 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children's Day 解题报告
- Hdu 4706 Children's Day -- 输出图形
- [ACM] hdu 4706 Children's Day
- HDU-#4706 Children's Day(模拟)
- HDU 4706 Children's Day(模拟)
- 【HDU 4706】【水题】Children's Day
- HDU 4706 Children Day
- HDU 4706 Children's Day (热身赛第一题)
- 浅谈矩阵分解在推荐系统中的应用(转发)
- iOS6和iPhone5使用第三方静态库在真机无法运行的处理
- C++自删除
- cx_Oracle模块学习之绑定变量
- JSP EL表达式详细介绍
- HDU 4706 Children's Day
- extremedb 的测试步骤及对比报告
- iOS应用程序状态切换相关
- hdu 4715
- 个性化推荐系统简述
- 使用Xcode和Instruments调试解决iOS内存泄露
- JavaScript操作Table
- css怎么让div居中
- ifram块不随内容拉伸问题