From d545e83aa52f4fe879784ac194a7c8f0a57cab0e Mon Sep 17 00:00:00 2001 From: flykhan Date: Fri, 16 Jun 2023 16:33:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=88=B6=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day5/d3.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 day5/d3.cpp diff --git a/day5/d3.cpp b/day5/d3.cpp new file mode 100644 index 0000000..899afaf --- /dev/null +++ b/day5/d3.cpp @@ -0,0 +1,12 @@ +// 进制转换 +#include + +using namespace std; + +int main() +{ + int n1 = 037, n2 = 0x3a; + cout << "037 = " << n1 << endl; // 以10进制输出八进制数 + cout << "0x3a = " << n2 << endl; // 以10进制输出十六进制数 + return 0; +} \ No newline at end of file