摘要: //控制输出精度;可以用iostream中的precision或是用iomanip中的setrecision;#include<iostream>#include<iomanip>using namespace std;int main(){ float a=4.5891589; //cout<<fixed; //cout<<setprecision(3)<<a<<endl; cout.precision(2);//默认模式下,它指的是显示的总位数; cout<<a<<endl; cout.setf 阅读全文
posted @ 2012-07-27 09:42 zh yu 阅读(1572) 评论(0) 推荐(0) 编辑