28_下面是整数输出的例子.cpp

//2007年9月29日12:58:22

#include <iostream>

#include <iomanip>

using namespace std;

int main()
{
	int b = 123456;
	
	cout<<b<<endl;
	cout<<hex<<b<<endl;
	cout<<setiosflags(ios::uppercase)<<b<<endl;
	cout<<setw(10)<<b<<','<<b<<endl;
	cout<<setfill('*')<<setw(10)<<b<<endl;
	cout<<setiosflags(ios::showpos)<<b<<endl;

	return 0;
}

/*
在VC++6.0中运行的结果是:
-------------------------
123456
1e240
1E240
     1E240,1E240
*****1E240
1E240
Press any key to continue
-------------------------
*/

你可能感兴趣的:(28_下面是整数输出的例子.cpp)