有时,我们需要输出确定小数位数的double,可以先引入如下头文件:
#include <iomanip>
然后通过下列方式输出:
double zzz = 8.66666;
cout << fixed << setprecision() << zzz << endl;
或者:
if ((aid % (int(allTime / deltaT) / files)) == ) {
cout << fixed << setprecision() << double(curTime / allTime) * << "% has been calculated..." << endl;
}