zne*_*eak 12
Java的:
String binary = "110010101011";
int decimal = Integer.parseInt(binary, 2);
Run Code Online (Sandbox Code Playgroud)
C++:
#include <cstdlib>
const char* binary = "110010101011";
int decimal = strtol(binary, NULL, 2);
Run Code Online (Sandbox Code Playgroud)
这是Integer.parseInt的Javadoc页面,这是strotol的联机帮助页面.
| 归档时间: |
|
| 查看次数: |
4766 次 |
| 最近记录: |