进制转换

This commit is contained in:
flykhan 2023-06-16 16:33:32 +08:00
parent 1f93e821ed
commit d545e83aa5
1 changed files with 12 additions and 0 deletions

12
day5/d3.cpp Normal file
View File

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