输出整数

来源:互联网 发布:安装软件乱码 编辑:程序博客网 时间:2024/05/19 03:45
#include<iostream>
#include<iomanip>
using namespace std;
int main ()
{int b=123456;
cout<<b<<'\n';
cout<<hex<<b<<'\n';
cout<<setiosflags(ios::uppercase)<<b<<'\n';
cout<<setiosflags(ios::fixed);
cout<<setw(10)<<b<<','<<b<<'\n';
cout<<setfill('*')<<setw(10)<<b<<'\n';
cout<<setiosflags(ios::showpos)<<b<<'\n';
return 0;
}