题解 | #温度转换#
温度转换
https://www.nowcoder.com/practice/ba83647087b7447783fa2384da6b3d44
// 整型数据相除默认为整型,所以必需有个数为浮点型,才有浮点型的结果
#include<iostream>
#include<iomanip>
using namespace std;
// 整型数据相除默认为整型
int main()
{
double f,c;
while(cin>>f)
{
c=(5*(f-32))/9;
cout<<fixed<<setprecision(3)<<c;
}
return 0;
}
查看13道真题和解析