hexoct1.cpp

来自「C++ Primer Plus(第五版)第3章例题代码」· C++ 代码 · 共 17 行

CPP
17
字号
// hexoct1.cpp -- shows hex and octal constants
#include <iostream>
using namespace std;
int main()
{
    using namespace std;
    int chest = 42;     // decimal integer constant
    int waist = 0x42;   // hexadecimal integer constant
    int inseam = 042;   // octal integer constant

    cout << "Monsieur cuts a striking figure!\n";
    cout << "chest = " << chest << "\n";
    cout << "waist = " << waist << "\n";
    cout << "inseam = " << inseam << "\n";
    return 0; 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?