洛谷B2022
题目描述
读入一个双精度浮点数,保留 12位小数,输出这个浮点数。
输入格式
只有一行,一个双精度浮点数。
输出格式
也只有一行,保留 12 位小数的浮点数。
运行代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x;
cin>>x;
cout<<fixed<<setprecision(12)<<x<<endl;
}
运行结果:
洛谷B2022
题目描述
读入一个双精度浮点数,保留 12位小数,输出这个浮点数。
输入格式
只有一行,一个双精度浮点数。
输出格式
也只有一行,保留 12 位小数的浮点数。
运行代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x;
cin>>x;
cout<<fixed<<setprecision(12)<<x<<endl;
}
运行结果: