fig11_16.cpp
来自「经典vc教程的例子程序」· C++ 代码 · 共 24 行
CPP
24 行
// Fig. 11.16: fig11_16.cpp
// Using hex, oct, dec and setbase stream manipulators.
#include <iostream.h>
#include <iomanip.h>
int main()
{
int n;
cout << "Enter a decimal number: ";
cin >> n;
cout << n << " in hexadecimal is: "
<< hex << n << '\n'
<< dec << n << " in octal is: "
<< oct << n << '\n'
<< setbase( 10 ) << n << " in decimal is: "
<< n << endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?