其调用头文件是#include <iomanip>
cout<<setiosflags(ios::fixed)<<setprecision(精确的小数位数)<<a;
或直接用printf语句
printf("%.4f\n",a) 红色的数(4)是精确小数位数