牛客网 ACM 竞赛 18839 - 输出浮点数 (C++ 代码示例)
#include
using namespace std;
int main() { double num; cin >> num; cout << fixed << setprecision(3) << num << endl; //使用fixed设置浮点数输出的模式,setprecision设置输出的小数位数为3
return 0;
}
原文地址: http://www.cveoy.top/t/topic/f2QW 著作权归作者所有。请勿转载和采集!