#include<iomanip>
void student::show()
{
using namespace std;
cout.setf(ios::fixed);
cout.precision(
2);
cout<<
"ID:"<<ID<<endl
<<
"name:"<<name<<endl;
}
要包含头文件:#include<iomanip> 补零:cout.setf(ios::fixed); 设置精度:cout.precision(2);
转载请注明原文地址: https://www.6miu.com/read-96508.html