Hello World!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 779 Accepted Submission(s): 313
Problem Description
Your task is to print ... er ... "Hello World" ... in a fantastic way -- using a beautiful font.
I've sent you a nice font for you to use, but I'm too busy to tell you how. Can you help yourself?
I've sent you a nice font for you to use, but I'm too busy to tell you how. Can you help yourself?
Input
The first line contains a single integer T (T <= 20), the number of test cases.
Each case begins with an integer C (1 <= C <= 80) in a single line, then each of the following C lines contains five two-digit numbers in hex (letters will be in uppercase). Don't ask me what they mean, I'm too busy...
Each case begins with an integer C (1 <= C <= 80) in a single line, then each of the following C lines contains five two-digit numbers in hex (letters will be in uppercase). Don't ask me what they mean, I'm too busy...
Output
For each test case, print the case number in the first line, then followed by a blank line.
After that, print all T characters. Use a single blank column of spaces between two consecutive characters. Each line should have exactly 6C-1 character (again, don't ask me why).
Don't forget to print another blank line after the output of each test case.
After that, print all T characters. Use a single blank column of spaces between two consecutive characters. Each line should have exactly 6C-1 character (again, don't ask me why).
Don't forget to print another blank line after the output of each test case.
Sample Input
2117F 08 08 08 7F38 54 54 54 1800 41 7F 40 0000 41 7F 40 0038 44 44 44 3800 00 00 00 003F 40 38 40 3F38 44 44 44 387C 08 04 04 0800 41 7F 40 0038 44 44 48 7F514 08 3E 08 1404 02 01 02 0440 40 40 40 4004 02 01 02 0414 08 3E 08 14
Sample Output
Case 1:# # ## ## # # ## ## # # # # # # ## # ### # # ### # # ### # ## # ## ###### # # # # # # # # # # # ## # # # ### # ##### # # # # # # # # # # # # ## # # # # # # # # # # # # # # ## # ### ### ### ### # # ### # ### ####Case 2: # # # # # # # # # # # # # # # # # # ### ### # # # # # # # # #####
Source
问题链接:HDU3257 ZOJ3247 Hello World!。
问题简述:参见上述链接。
问题分析:图案输出,关键在于读懂题意。
程序说明:
需要注意16进制数的输入方法。
需要注意位运算。
需要注意用方便的数据表示(这里用一维数组比较方便)。
需要注意循环控制条件。
题记:(略)
AC的C++语言程序如下:
/* HDU3257 ZOJ3247 Hello World! */
#include <iostream>
#include <cstdio>
using namespace std;
const int N = 7;
const int ROW = 80;
const int COL = 5;
int a[ROW * COL];
int main()
{
int t, c;
scanf("%d", &t);
for(int k=1; k<=t; k++) {
scanf("%d", &c);
for(int i=0; i<c*COL; i++)
scanf("%x", &a[i]);
printf("Case %d:\n\n", k);
for(int i=0; i<N; i++) {
int bit = (1 << i);
for(int j=0; j<c*COL; j++) {
if(j != 0 && j % COL == 0)
printf(" ");
printf("%c", ((a[j] & bit) ? '#' : ' '));
}
printf("\n");
}
printf("\n");
}
return 0;
}