//Date 2013/1/22
//test for 19 manipulator
//dec, endl, fixed, hex, oct, left, right
//scientific, setfill(c), setprecision(n), setw(n)
//showpoint, showpos
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int num = 5201314;
double dn = 5.201314;
cout << "num: " << num << endl;
cout << "dec: " << dec << num << endl;
cout << "oct: " << oct << num << endl;
cout << "hex: " << hex << num << endl;
cout << "dn : " << dec << num << endl;
cout << setw(20) << fixed << dn << endl;
cout << setw(20) << scientific << dn << endl;
cout << setw(20) << left << showpoint << showpos << dn << endl;
cout << setw(20) << setprecision( 2 ) << setfill('*') << dn << endl;
return 0;
}
cpp_manipulator
最新推荐文章于 2024-06-21 15:35:00 发布