运行 ❯
建立您
自己的
网站
×
更改方向
更改主题,深色/浅色
前往 Spaces
#include <stdio.h> // Function to convert Fahrenheit to Celsius float toCelsius(float fahrenheit) { return (5.0 / 9.0) * (fahrenheit - 32.0); } int main() { // Set a fahrenheit value float f_value = 98.8; // Call the function with the fahrenheit value float result = toCelsius(f_value); // Print the fahrenheit value printf("Fahrenheit: %.2f\n", f_value); // Print the result printf("Convert Fahrenheit to Celsius: %.2f\n", result); return 0; }
华氏温度: 98.80
华氏温度转换为摄氏温度: 37.11