執行 ❯
建立您
自己的
網站
×
更改方向
更改主題,深色/淺色
前往 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