static int get (char[] s, int b) {
int res = 0;
for (char c : s) {
res = res * b + (c - '0');
}
return res;
}
b进制转10进制模板
最新推荐文章于 2024-09-10 10:21:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
static int get (char[] s, int b) {
int res = 0;
for (char c : s) {
res = res * b + (c - '0');
}
return res;
}