C++中精确到小数点后任意位

#include <iostream>  
#include <iomanip>  
//用setprecision(n)设置精度,其中n表示精确到小数点后n位  
using namespace std;

void main()
{
    double aa = 10;    
    cout << fixed << setprecision(500) << aa << endl;
    system("pause");
}

 

posted @ 2017-11-23 18:18  P_langen  阅读(13426)  评论(0编辑  收藏  举报