c++用流控制成员函数输出数据

#include
#include

using namespace std;

int main()
{
    int a=10;
    double b=314159.26;
    cout<endl;
    cout.unsetf(ios::dec);
    cout.setf(ios::oct|ios::showbase);
    cout<endl;
    cout.precision(7);
    cout<endl;
    cout.setf(ios::fixed);
    cout.precision(4);
    cout<endl;
    cout.setf(ios::scientific|ios::uppercase|ios::left);
    cout.width(20);
    cout.fill('*');
    cout<<-b<<endl;
    cout.unsetf(ios::scientific|ios::uppercase);
    cout.precision(6);
    cout.width(20);
    cout.fill(' ');
    cout<endl;  
    return 0;
} 

 

你可能感兴趣的:(c++用流控制成员函数输出数据)