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