利用公式 C=5×(F−32)÷9(其中 C 表示摄氏温度,F 表示华氏温度) 进行计算转化,输入华氏温度 F,输出摄氏温度 C,要求精确到小 数点后 5 位。
#include <stdio.h>
#include <math.h>
int main ()
{
double C , F ;
printf("请输入华氏温度:");
scanf("%lf",&F);
C = 5 * ( F - 32 ) / 9;
printf("摄氏温度为%.5f",C);
return 0;
}