HDU3257 Hello World!
Hello World!
I've sent you a nice font for you to use, but I'm too busy to tell you how. Can you help yourself?
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...
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.
2
11
7F 08 08 08 7F
38 54 54 54 18
00 41 7F 40 00
00 41 7F 40 00
38 44 44 44 38
00 00 00 00 00
3F 40 38 40 3F
38 44 44 44 38
7C 08 04 04 08
00 41 7F 40 00
38 44 44 48 7F
5
14 08 3E 08 14
04 02 01 02 04
40 40 40 40 40
04 02 01 02 04
14 08 3E 08 14
Case 1: # # ## ## # # ## #
# # # # # # # #
# # ### # # ### # # ### # ## # ## #
##### # # # # # # # # # # # ## # # # ##
# # ##### # # # # # # # # # # # # #
# # # # # # # # # # # # # # # #
# # ### ### ### ### # # ### # ### #### Case 2: # #
# # # # # #
# # # # # # # # # #
### ###
# # # # # #
# #
#####
题意:前面基本上都是废话,主要是让你自己看输入输出找规律。
题解:坑人的地方是这题输出的时候事实上是7行,而不是8行!!!因此PE了N次!
#include <stdio.h>
#define maxn 482 char map[8][maxn];
bool isPrint[8]; void getIsPrint(int n)
{
for(int i = 0; i < 7; ++i){
isPrint[i] = n & 1;
n >>= 1;
}
} int main()
{
//freopen("stdout.txt", "w", stdout);
int t, n, arr[5], i, j, id, k, cas = 1;
scanf("%d", &t);
while(t--){
scanf("%d", &n);
for(i = id = 0; i < n; ++i){
for(j = 0; j < 5; ++j, ++id){
scanf("%X", arr + j);
getIsPrint(arr[j]);
for(k = 0; k < 7; ++k)
if(isPrint[k]) map[k][id] = '#';
else map[k][id] = ' ';
}
if(i != n - 1){
for(k = 0; k < 7; ++k)
map[k][id] = ' ';
++id;
}
}
printf("Case %d:\n\n", cas++);
for(k = 0; k < 7; ++k){
map[k][id] = '\0';
printf("%s\n", map[k]);
}
printf("\n");
}
return 0;
}
HDU3257 Hello World!的更多相关文章
- hdu3257【模拟】
题意: 从案例找: 思路: 就是16进制,然后到2进制= =.就是个模拟= =.注意格式: #include <bits/stdc++.h> using namespace std; ty ...
随机推荐
- Python 30分钟入门——数据类型 & 控制结构
Python是一门脚本语言,我也久闻大名,但正真系统的接触学习是在去年(2013)年底到今年(2014)年初的时候.不得不说的是Python的官方文档相当齐全,假设你是在Windows上学习Pytho ...
- jsp 分页(数据库读取数据)
<%@ page contentType="text/html; charset=gb2312"%> <%@ page language="java&q ...
- Apache Thrift的简单使用
Apache Thrift的简单使用 ---------------------- 1. 简介 Thrift是Facebook的一个开源项目,主要是一个跨语言的服务开发框架.它有一个代码生成器来对它所 ...
- Linkedin工程师是如何优化他们的Java代码的(转)
英文原文:LinkedIn Feed: Faster with Less JVM Garbage 最近在刷各大公司的技术博客的时候,我在Linkedin的技术博客上面发现了一篇很不错博文.这篇博文介绍 ...
- Boost::asio io_service 实现分析
io_service的作用 io_servie 实现了一个任务队列,这里的任务就是void(void)的函数.Io_servie最常用的两个接口是post和run,post向任务队列中投递任务,run ...
- Java中@Deprecated、@SupressWarning、@Override的作用
Annotation注解在 Java 中有着很广泛的,他是做为一种标识 为javac所识别.每一个注解 都对应这一个Java类 在java.lang包中 有三个注解 分别是 Deprecated ...
- Android 环境变量配置(Mac)
Mac 系统10.10,自带的就是jdk1.6,因为工作需要就升级到了1.7,要从新配置环境变量了 mac 默认是自带的有jdk1.6 安装路径为: /System/Library/Framework ...
- TWinControl.DefaultHandler处理WM_CTLCOLORMSGBOX..WM_CTLCOLORSTATIC消息的两个参数很有意思,两个都是传递句柄
procedure TWinControl.DefaultHandler(var Message); begin then begin with TMessage(Message) do begin ...
- jni 入门 android的C编程之旅 --->环境搭建&&helloworld
需要进行jni的开发有一下几个条件: 1:能初步使用C/C++如果不会,请参读 谭浩强的 C编程语言 2:android应用开发已经基本入门,如果没有,请先行学习 这两个条件基本满足后,我们开始了: ...
- 动态规划-hdoj-4832-百度之星2014初赛第二场
Chess Problem Description 小度和小良近期又迷上了下棋.棋盘一共同拥有N行M列,我们能够把左上角的格子定为(1,1),右下角的格子定为(N,M).在他们的规则中,"王 ...