标签:ios style pre std iostream ble precision 输出 ret
题目:
输入华氏温度 f ,输出对应的摄氏温度 c,保留3位小数。提示:c = 5( f - 32) / 9
思路:
直接计算即可。
代码:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double f = 0.0;
cin >> f;
double c = 5 * (f - 32) / 9;
cout << setprecision(3) << fixed << c << endl;
return 0;
}
标签:ios style pre std iostream ble precision 输出 ret
原文地址:https://www.cnblogs.com/Hello-Nolan/p/12110166.html