我有一个如下所示的 mac 地址482C6A1E593D,我想将其返回为类似这样的地址48:2C:6A:1E:59:3D
我已经能够编写这段代码:
Pattern.compile("(.{2})").matcher(macAddress).replaceAll("$1:");
Run Code Online (Sandbox Code Playgroud)
然而它返回48:2C:6A:1E:59:3D:而不是48:2C:6A:1E:59:3D我想忽略最后一个匹配以避免最后一个:
我怎么解决:2 ^ 200'000在C中
我尝试了几个解决方案:
unsigned long long int variable = 1;
int i = 0;
for(i = 0; i < 200000; i++) {
variable *= 2;
}
printf("%llu", variable);
Run Code Online (Sandbox Code Playgroud)
我得到了结果:0
我也累了:
variable = 1 << 200000;
Run Code Online (Sandbox Code Playgroud)
我得到了同样的结果
而且:
pow(2, 200000);
Run Code Online (Sandbox Code Playgroud)
我得到了结果: inf
我知道结果将是一个非常大的数字!