1024:保留3位小数的浮点数
时间: 2023-10-12 20:06:39 浏览: 107
1025 保留12位小数的浮点数.cpp
题目要求保留3位小数的浮点数。可以使用`printf`函数来实现这个功能。具体的代码如下所示:
```c++
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
double num;
scanf("%lf",
#### 引用[.reference_title]
- *1* [1025 保留12位小数的浮点数.cpp](https://download.csdn.net/download/Chinajsczlymyc/12377613)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [【信息学奥赛】1024:保留3位小数的浮点数(C++)](https://blog.csdn.net/weixin_62460981/article/details/122975369)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [1024:保留3位小数的浮点数](https://blog.csdn.net/nmk__123/article/details/124594223)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文