扩展十六进制数范围不在连续的甲酸盐中 [英] expanding Hex number range not in continous formate

查看:69
本文介绍了扩展十六进制数范围不在连续的甲酸盐中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我想扩展十六进制数范围而不是连续方式


这是我输入的文本文件...


0x0:0xF


我想扩大范围(当有范围时)并且有所有包括领先的0'。


这是我要找的输出...


0

4

8

C


我发现的所有信息都是生成连续的十六进制数....任何帮助将不胜感激。


谢谢&问候

Apurva

Hi There,

I want to expand Hex number range but not the continuous manner

Here is what I have input text file...

0x0:0xF


I would like to expand the range (when there is a range) and have all including the leading 0''s.

Here is the output I am looking for...

0
4
8
C


All the information I found was to generate continuous Hex number.... any help would be appreciated.

Thanks & Regards
Apurva

推荐答案

您是否尝试过自己解决这个问题?

我们能看到什么你到目前为止?
Have you attempted to solve this problem on your own?
Can we see what you have so far?


试试这个。它不会从文件中获取数据,但会生成范围:
Try this. It doesn''t take data from a file, but it generates the range:
展开 | 选择 | Wrap | 行号


@computerfox,

我不想冒犯你,但这是非常差的质量代码。


你不应该使用原型,除非你知道并想要/需要他们的副作用。并且,声明一个词法变量代替原型定义是无效的语法。


你没有使用strict和warnings pragma,它应该在每个脚本中。如果你曾经使用它们,那么脚本甚至都不会编译。


循环的C样式很乱,并不像perl'正常的循环结构那样高效。


我可以指出大约有六个其他问题,但我不想过火。
@computerfox,

I don''t wish to offend you, but that is very poor quality code.

You should not use prototypes unless you know about and want/need their side effects. And, declaring a lexical var in place of a prototype definition is invalid syntax.

You''re failing to use the strict and warnings pragmas, which should be in every script. If you had used them, the script would not even compile.

The C style for loop is messy and not as efficient as perl''s normal for loop construct.

There are about a half dozen other issues I can point out, but I don''t want to go overboard.


这篇关于扩展十六进制数范围不在连续的甲酸盐中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆