8 条题解
-
2
这道题要注意是单精度浮点数,应使用float (PS:最后有彩蛋科普哟🎉️)
#include <bits/stdc++.h> using namespace std; int main() { float a; cin >> a; cout << fixed << setprecision(3) << a; //使用setprecision保留3位小数 return 0; }
彩蛋:
科普一下,浮点数分为三类:
1.单精度浮点数(float)占4字节
2.双精度浮点数(double)占8字节
3.高双精度浮点数(long double)占8字节
已AC,食用代码记得点赞哟🎉️
- 1
信息
- ID
- 90
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 1
- 标签
- 递交数
- 285
- 已通过
- 201
- 上传者