自考新教材-p300_4(2)

陬者

关注

阅读 196

2022-06-08

源程序:

#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)

0 0 举报