上例子:
#include
#include
using namespace std;
int main()
{
double n=3.1415926;
cout << fixed << setprecision(3) << n << endl;
}
运行结果:
上例子:
#include
#include
using namespace std;
int main()
{
double n=3.1415926;
cout << fixed << setprecision(3) << n << endl;
}
运行结果: