题目链接
题目描述
读入一个浮点数,保留 12 位小数,输出这个浮点数。
输入格式
只有一行,一个浮点数 x(0 ≤ x ≤ 10)。
输出格式
也只有一行,保留 12 位小数的浮点数。
Sample Input
3.1415926535798932
Sample Output
3.141592653580
思路
读入一个浮点数,保留 12 位小数,输出。输出 12 位小数,也就是%.12lf。
C++代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x;
while(cin >> x)
printf("%.12lf\n", x);
return 0;
}