C++如何将一个整数输出为小数 double a=3; //一定是double不能是int cout.setf(ios::fixed); cout.precision(2); cout<<a<<endl; 输出:3.00