#include <stdio.h>
void Temperatures (double T);
int main (void)
{
double Fnum;
printf ("请输入华氏温度 :");
scanf ("%lf",&Fnum);
while (Fnum != 'q' ){
Temperatures (Fnum);
printf ("\n请继续输入: ");
scanf ("%lf",&Fnum);
}
printf ("输入完毕\n");
return 0;
}
void Temperatures (double T)
{
double FAHRENHEIT,CELSIUS,KELVIN;
FAHRENHEIT = T;
//华氏温度
CELSIUS = 1.8 * FAHRENHEIT +32.0 ;
//华氏转摄氏度
KELVIN = CELSIUS + 273.16;
//摄氏转绝对温度
printf ("华氏温度\t摄氏温度\t绝对温度\n ");
printf ("%5.2lf\t\t%5.2f\t\t%5.2lf",FAHRENHEIT,CELSIUS,KELVIN);
}
修改后的。