http://c.biancheng.net/view/275.html
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long ll;
int main() {
int a=123;
cout<<oct<<a<<ends<<dec<<a<<ends<<hex<<a<<ends<<showbase<<a<<endl;
cout<<showbase<<setbase(8)<<a<<ends<<setbase(10)<<a<<endl;
cout<<showpoint<<a<<endl;
cout<<showpos<<a<<endl;
cout<<noshowpos;
double b=1e-8+123456;
cout<<fixed<<b<<endl;
cout<<setprecision(10)<<fixed<<b<<endl;
cout<<setw(13)<<setprecision(10)<<fixed<<b<<endl;
b=123;
cout<<scientific<<b<<endl;
a=123;
cout<<setfill('a')<<setw(10)<<a<<endl;
return 0;
}
|