编程介的小学生 2017-08-23 04:18 采纳率: 20.5%
浏览 701
已采纳

Hexadecimal View

Hexadecimal is very important and useful for computer programmers. You are requested to provide a hexadecimal view for given data. The hexadecimal view is made up of one or more rows. Every row except the last one represents 16 characters. Each row consists of three columns separated by a space:

addr: the 4-digit hexadecimal beginning address of this row.
dump: the hexadecimal representation of this row, separating every two characters by a whitespace. If there are less than 16 characters in the last row, pad it with spaces.
text: the ASCII translation of this row, with uppercase characters converted to lowercase and lowercase characters converted to uppercase.
Use lowercase for the letter digits. See sample for more details.
Input

There are multiple test cases. Each line is a test case. The line is made up of no less than 1 and no more than 4096 printable characters including spaces.

Output

For each test case, output its hexadecimal view. Do not output any extra spaces after the last character of text.

Sample Input

Hex Dump
#include
printf("Hello, World!\n");
main = do getLine >>= print . sum . map read . words
Sample Output

0000: 4865 7820 4475 6d70 hEX dUMP
0000: 2369 6e63 6c75 6465 203c 6373 7464 696f #INCLUDE 0010: 3e >
0000: 7072 696e 7466 2822 4865 6c6c 6f2c 2057 PRINTF("hELLO, w
0010: 6f72 6c64 215c 6e22 293b ORLD!\N");
0000: 6d61 696e 203d 2064 6f20 6765 744c 696e MAIN = DO GETlIN
0010: 6520 3e3e 3d20 7072 696e 7420 2e20 7375 E >>= PRINT . SU
0020: 6d20 2e20 6d61 7020 7265 6164 202e 2077 M . MAP READ . W
0030: 6f72 6473 ORDS

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-08-27 14:51
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况