#include
#include
void Temperatures(double n);
int main(void)
{
double Fahrenheit;
printf("输入华氏温度:\n");
scanf("%lf", &Fahrenheit);
while (Fahrenheit)
{
Temperatures(Fahrenheit);
printf("再次输入华氏温度:\n若要推出程序请输入非数字值\n");
scanf("%lf", &Fahrenheit);
}
system("pause");
return 0;
}
void Temperatures(double n)
{
const double 华氏转摄氏1 = 1.8;
const double 华氏转摄氏2 =32.0;
const double 摄氏转绝对 = 273.16;
double Celsius,Kelvin;
Celsius = n * 华氏转摄氏1+ 华氏转摄氏2;
Kelvin = Celsius + 摄氏转绝对;
printf("%.2f\n%.2f\n%.2f\n", n, Celsius, Kelvin);
}