12 lines
259 B
C++
12 lines
259 B
C++
|
// 进制转换
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int n1 = 037, n2 = 0x3a;
|
||
|
cout << "037 = " << n1 << endl; // 以10进制输出八进制数
|
||
|
cout << "0x3a = " << n2 << endl; // 以10进制输出十六进制数
|
||
|
return 0;
|
||
|
}
|