0
点赞
收藏
分享

微信扫一扫

自考新教材-287

Hyggelook 2022-06-08 阅读 138

源程序:

//程序7-8

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

double x = 12.34;

cout << "1)" << setiosflags(ios::scientific | ios::showpos) << x << endl;

cout << "2)" << setiosflags(ios::fixed) << x << endl;

cout << "3)" << resetiosflags(ios::fixed) << setiosflags(ios::scientific | ios::showpos) << x << endl;

cout << "4)" << resetiosflags(ios::showpos) << x << endl;     //清除要输出正号的标志

system("pause");

return 0;

}

运行结果:

自考新教材-287_源程序


举报

相关推荐

0 条评论