C++基础编程100题-010 OpenJudge-1.3-08 温度表达转化

010 OpenJudge-1.3-08 温度表达转化

http://noi.openjudge.cn/ch0103/08/

描述

利用公式 C = 5 * (F-32) / 9 (其中C表示摄氏温度,F表示华氏温度) 进行计算转化。

输入

输入一行,包含一个实数f,表示华氏温度。(f >= -459.67)

输出

输出一行,包含一个实数,表示对应的摄氏温度,要求精确到小数点后5位。

样例输入

41

样例输出

5.00000

提示

C/C++,使用double

参考程序

#include<bits/stdc++.h>
using namespace std;

int main(){
	double f,c;
	cin>>f;
	c=5.0*(f-32)/9;
	printf("%.5f",c);
}
posted @ 2023-03-15 19:01  new-code  阅读(61)  评论(0)    收藏  举报