自考新教材-p300_4(2)

时间:2020-02-05 10:32:00   收藏:0   阅读:63

源程序:

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main()
{
double x = 3;
cout << setiosflags(ios::showpoint|ios::fixed)<<x << endl;
cout << setw(4)<<resetiosflags(ios::showpoint|ios::fixed)<< x << endl;
cout << setw(5) << setiosflags(ios::showpos) << x << endl;
system("pause");
return 1;
}

运行结果:

技术分享图片

 

原文:https://www.cnblogs.com/duanqibo/p/12262528.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!