以下是使用 Python 语言实现的代码: ```python f = float(input("请输入华氏温度:")) c = 5 / 9 * (f - 32) print("%.2f" % c) ``` 如果您使用的是其他编程语言,例如 C++: ```cpp #include <iostream> using namespace std; int main() { double f; cout << "请输入华氏温度:"; cin >> f; double c = 5.0 / 9 * (f - 32); printf("%.2f\n", c); return 0; } ``` 如果是 Java 语言: ```java import java.util.Scanner; public class TemperatureConversion { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("请输入华氏温度:"); double f = scanner.nextDouble(); double c = 5.0 / 9 * (f - 32); System.out.printf("%.2f", c); scanner.close(); } } ``` [2024-09-30 00:19:15 | AI写代码神器 | 259点数解答]