⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setiosf1.cpp

📁 C++的常用算法
💻 CPP
字号:
//这个程序在本书所带软盘中,文件名为SETIOSF1.CPP
//这个程序用输入/输出流标记控制操作setiosflags()控制输出。

#include <iostream.h>
#include <iomanip.h>		//这个头文件支持输入/输出流标记控制操作setiosflags()

void main(void)
{
    cout << "系统设置的输出为:" << 2.13<< endl;
	cout << "showpoint设置的输出为:" << setiosflags(ios::showpoint) << 2.13 << endl;
	cout << "fixed设置的输出为:" << setiosflags(ios::fixed) << 2.13 << endl;
	cout << "清除fixed后的输出为:"<< resetiosflags(ios::fixed)<< 2.13 << endl;
							//将系统设置回fixed以前的输出标记
	cout << "清除showpoint后的输出为:" << resetiosflags(ios::showpoint) << 2.13 << endl;
							//将系统设置回showpoint以前的输出标记
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -