标签:c++
// hex,oct 输出
#include<iostream>
using namespace std;
int main()
{
int chest = 42, waist = 42, inseam = 42;
cout << "chest = " <<chest << " (decimal for 42)" << endl;
cout << hex; // manipulator for changing number base
cout << "waist = " << waist << " (hexadecimal for 42)" << endl;
cout << oct; //manipulator for changing number base
cout << "inseam = " << inseam << " (octal for 42)" << endl;
return 0;
} C++ cout的转换格式输出(八进制和十六进制),布布扣,bubuko.com
标签:c++
原文地址:http://blog.csdn.net/xln0539xln/article/details/38751383