手机的网站建设目标是什么今天北京感染了多少人
【温度表达转化】
- C语言代码
 - C++代码
 - Java代码
 - Python代码
 
|    💐The Begin💐点点关注,收藏不迷路💐    | 
利用公式 C=5∗(F−32)/9 (其中C表示摄氏温度,F表示华氏温度) 进行计算转化。
输出
输出一行,包含一个实数,表示对应的摄氏温度,要求精确到小数点后5位。
样例输入
51
 
样例输出
10.55556
 
C语言代码
#include <stdio.h>int main() {double f;  // 用于存储输入的华氏温度scanf("%lf", &f);  // 读取华氏温度值double c = 5 * (f - 32) / 9;  // 根据公式计算摄氏温度printf("%.5lf\n", c);  // 输出摄氏温度,精确到小数点后5位return 0;
}
 
C++代码
#include <iostream>
#include <iomanip>int main() {double f;  // 用于存储输入的华氏温度std::cin >> f;  // 读取华氏温度值double c = 5 * (f - 32) / 9;  // 根据公式计算摄氏温度std::cout << std::fixed << std::setprecision(5) << c << std::endl;  // 输出摄氏温度,精确到小数点后5位return 0;
}
 
Java代码
import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);double f = scanner.nextDouble();  // 读取华氏温度值double c = 5 * (f - 32) / 9;  // 根据公式计算摄氏温度System.out.printf("%.5f\n", c);  // 输出摄氏温度,精确到小数点后5位}
}
 
Python代码
f = float(input())  // 读取华氏温度值c = 5 * (f - 32) / 9  // 根据公式计算摄氏温度print("%.5f" % c)  // 输出摄氏温度,精确到小数点后5位
 

|    💐The End💐点点关注,收藏不迷路💐    | 
