赞
踩
C++ 中保留两位小数,首先需要包含头文件#include<iomanip>
cout.setf(ios::fixed); cout <<setprecision(2)<<max<<endl;
cout.setf(ios::fixed);cout <<setprecision(2)<<max<<endl;