首页 > 编程知识 正文

什么时候用iomanip头文件,cstdio头文件是什么

时间:2023-05-06 18:04:01 阅读:172962 作者:1409

iomanip在c程序中经常看到以下头文件#include : io表示输入输出,manip是manipulator (机械手)的缩写)在c中只对输入缩写有效。

具体使用方法:

# include iostream # includeiomanipusingnamespacestd; int main () { double PI=3.141592654; coutPIendl; coutsetprecision(2) PIendl; coutfixedsetprecision(2) PIendl; coutsetfill('* ' ) setw ) setprecision ) PIendl; //一般使用setw (首先是setw )控制输出结果所占的位数,然后是结果coutsetfill('* ' ) setw 20 ) setprecision ) leftPIendl; coutscientificsetprecision(10 ) PIendl; coutscientificuppercasesetprecision (10 ) PIendl; //uppercase输出的字母为大写的return 0; (输出结果为3.141592654 ) 3.14 * * * * * 3.1415926540 * * * 3.1415926540 e 000.1415926540 e 000 fixed运算符和最重要的是浮点数的http://www.) 不是要显示的有效位数的总和。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。