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 ...
随机推荐
- 改动项目APP名字后,在真机执行报错:The provisioning profile specified in your build settings (“haotian”) has an AppI
错误提醒:The provisioning profile specified in your build settings ("haotian") has an AppID of ...
- 使用【百度云推送】第三方SDK实现推送功能具体解释
之前介绍过怎样使用shareSDK实现新浪微博分享功能,今天介绍怎样使用百度云推送SDK实现Android手机后台推送功能. 执行效果例如以下 第一步,假设使用百度的SDK,当然要先成为百度的开发人员 ...
- MongoDB系列之二(主动复制)
目前我正在进行MongoDB的双机热备方面相关的工作.根据我目前看到的MongoDB方面的材料,MongoDB的实际部署有三种方式,分别是“主动复制”,“副本集”以及“分片副本集”. 首先我们从最简单 ...
- easyUI相关知识
$("#sportGroupInfoDialog").dialog("open");//打开一个对话框,设置这个对话框的的布局方式 $('#sportGroup ...
- C# - Byte类型与String类型互转
byte[] bs = Encoding.UTF8.GetBytes("你的字符串"); string str = Encoding.UTF8.GetString(bs);
- const对象默认是static的,而不是extern的
const 和 static 变量,可以放在头文件中 const对象默认是static的,而不是extern的,所以即使放在头文件中声明和定义.多个cpp引用同一个头文件,互相也没有感知,所以不会导致 ...
- ubuntu 常用软件
terminator:任意分割控制台 Sublime Text:文本编辑器,也是轻量级的IDE Wireshark:抓包工具 Okular:PDF等文档编辑工具 yEd:流程图等制图软件 Shutte ...
- Maven坐标 groupId artifactId version packaging classifier name
groupId定义项目属于哪个组,这个组往往和项目所在的组织或公司存在关联.譬如在googlecode上建立一个名为myapp的项目,那么groupId就应该是com.googlecode.myapp ...
- Swift - 使用Core Data进行数据持久化存储
一,Core Data介绍 1,Core Data是iOS5之后才出现的一个数据持久化存储框架,它提供了对象-关系映射(ORM)的功能,即能够将对象转化成数据,也能够将保存在数据库中的数据还原成对象. ...
- 《Swift编程语言》中文翻译及读书笔记page25
The Swift Programming Language读书笔记学习笔记 第25页 本页主要说在swift语言里能够使用分号,但分号不作为每条swift语言语句的结尾 而是间隔写在一行的多条swi ...