#include<iostream>
int main()
{
using namespace std;
float hats,heads;
cout.setf(ios_base::fixed,ios_base::floatfield);
cout<<"Enter a number:";
cin>>hats;
cout<<"Enter another number:";
cin>>heads;
cout<<"hats="<<hats<<"; heads="<<heads<<endl;
return 0;
}
程序输出是:
Enter a number:33.3
Enter another number:55.5
hats=33.299999
heads=55.000000
这是什么意思啊,对于cout.setf(ios_base::fixed,ios_base::floatfield);我不明白啊