0
点赞
收藏
分享

微信扫一扫

自考新教材-p300_4(2)

陬者 2022-06-08 阅读 195

源程序:

#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;
}

运行结果:

自考新教材-p300_4(2)_#include

 


举报

相关推荐

0 条评论