计算机数学

发布于 2024-10-05 01:31:35 字数 43 浏览 0 评论 0原文

我无法弄清楚十六进制之间的数字序列 288 和 2AO 我真的需要帮助。

I can not figure out the sequence of numbers between hexadecimal
288 and 2AO i really need help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

儭儭莪哋寶赑 2024-10-12 01:31:35
288 + 1 = 289
289 + 1 = 28A
   ...
28F + 1 = 290
290 + 1 = 291
   ...
29F + 1 = 2A0

您可能想知道,即使 Windows calc.exe 也提供了十六进制模式,并且 Google 本身就可以做到:)

288 + 1 = 289
289 + 1 = 28A
   ...
28F + 1 = 290
290 + 1 = 291
   ...
29F + 1 = 2A0

You might want to know that even Windows calc.exe provides a HEX mode and that Google itself can do it :)

独孤求败 2024-10-12 01:31:35

阅读,了解有关 16 进制数字系统的信息

十进制:

$ seq 0x288 0x2A0
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672

十六进制:

# printf "%x\n" `seq 0x288 0x2A0`
288
289
28a
28b
28c
28d
28e
28f
290
291
292
293
294
295
296
297
298
299
29a
29b
29c
29d
29e
29f
2a0

Read this for info on base-16 numeral system

Decimal:

$ seq 0x288 0x2A0
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672

Hex:

# printf "%x\n" `seq 0x288 0x2A0`
288
289
28a
28b
28c
28d
28e
28f
290
291
292
293
294
295
296
297
298
299
29a
29b
29c
29d
29e
29f
2a0
七七 2024-10-12 01:31:35

让我们从更简单的事情开始。按照您习惯的方式,以 10 为基数,32 到 45 之间的数字顺序是什么?

32 之后是 33, 34, 35... 39。然后,由于以 10 为基数的数字在 0 到 9 之间,因此前进到 40。最右边的数字回绕到 0,而其左边的数字变为一个更大,因此给你 40。从那里你继续 - 41,42,43,44,45。

现在,在其他基础上,这只是数字数量不同的问题。让我们考虑同样的问题 (32->45),但以 6 为基数。6 基数有六位数字 - 0,1,2,3,4,5。所以你从 32 到 33、34、35,在这里,就像你从 39 跳到 40 一样,你停了下来。 6 进制中没有 36 - 你从 5 到 0,然后增加左边的数字 - 因此是 40。从那里开始是 41,42,43,44,45。

现在,对于小于 10 的基数(如上面的 6 基数),这很容易 - 数字更少。但是 11 进制呢?基数 64?或者你的情况是 16 进制?你会如何表示第十一个数字?

在这里,约定很简单。数字变成字母。这些是基数 16(十六进制基数)的数字:

0 1 2 3 4 5 6 7 8 9 ABCDEF

所以第十一位数字是 A。第十六位数字是 F。让我们回到我的第一个示例,但以十六进制基数进行操作。您从 32 开始。转到 33、34...39,然后在 30 秒内继续执行 3A、3B、3C、3D、3E、3F,在这里您回绕到 0 - 并跳转到 40。这是完整的序列:

32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F,40,41,42,43,44,45

从这里你应该能够自己解决288-2A0。

祝你好运!

Let's start with something simpler. What's the sequence of numbers between 32 and 45, in the 10 base, as you're used to?

After 32, there's 33, 34, 35... 39. And then, since the digits in base-10 are between 0 and 9, you advance to 40. The rightmost digit wraps back to 0, and the digit on its left becomes one bigger, thus giving you 40. From there you continue - 41,42,43,44,45.

Now, in other bases, its simply a matter of a different amount of digits. Let's take the same question (32->45), but in base 6. Base 6 has six digits - 0,1,2,3,4,5. So you go from 32 to 33, 34, 35, and here, just like you jumped from 39 to 40, you stop. There is no 36 in base 6 - you go from 5 to 0, and then you increment the left digit - hence 40. From there it's 41,42,43,44,45.

Now, with bases which are less than 10 (like base 6 above), it's easy - there are less digits. But what about base 11? base 64? or in your case, base 16? How would you represent the eleventh digit?

Here, the convention is simple. The digits turn into letters. These are the digits for base 16, the hexadecimal base:

0 1 2 3 4 5 6 7 8 9 A B C D E F

So the eleventh digit is A. The sixteenth digit is F. Let's go back to my first example but do it in the hexadecimal base. You start with 32. Go to 33, 34... 39, and then you proceed within the 30s with 3A, 3B, 3C, 3D, 3E, 3F, and here you wrap back to 0 - and jump to 40. Here is the complete sequence:

32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F,40,41,42,43,44,45

From here you should be able to solve 288-2A0 by yourself.

Good luck!

仅冇旳回忆 2024-10-12 01:31:35

此 C 程序将输出以下值:

#include <stdio.h>

int main() {
    int i;

    for(i=0x288; i<=0x2A0; i++)
        printf("%X ", i);

    printf("\n");
    return 0;
}

输出: 288 289 28A 28B 28C 28D 28E 28F 290 291 292 293 294 295 296 297 298 299 29A 29B 29C 29D 29E 29F 2A0

这是您想要的吗?

This C program will output the values:

#include <stdio.h>

int main() {
    int i;

    for(i=0x288; i<=0x2A0; i++)
        printf("%X ", i);

    printf("\n");
    return 0;
}

Output: 288 289 28A 28B 28C 28D 28E 28F 290 291 292 293 294 295 296 297 298 299 29A 29B 29C 29D 29E 29F 2A0

Is this what you want?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文