c++用流控制成员函数输出数据
#include<iostream> #include<iomanip> using namespace std; int main() { int a=10; double b=314159.26; cout<<a<<endl; cout.unsetf(ios::dec); cout.setf(ios::oct|ios::showbase); cout<<a<<endl; cout.precision(7); cout<<b<<endl; cout.setf(ios::fixed); cout.precision(4); cout<<b<<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<<b<<endl; return 0; }
相关推荐
cuixingwudi 2020-07-26
数据与算法之美 2020-07-05
路漫 2020-06-26
earthhouge 2020-06-25
yunfeitian 2020-06-13
klarclm 2020-06-13
zhixingheyitian 2020-05-28
qscool 2020-05-17
cuiweisaidelike 2020-05-11
winmeanyoung 2020-05-08
alicelmx 2020-05-05
一只码畜 2020-04-22
拉斯厄尔高福 2020-04-18
muhongdi 2020-04-18
choupiaoyi 2020-04-06
wbczyh 2020-03-28
jeonkc 2020-03-26
狼窝 2020-03-20