想问问while(a == 1)在这个程序表示什么意思?
#include<stdio.h> void Temperatures(double);
const float K = 1.8;
const float A = 32.0;
const float B = 273.16;
int main(void)
{
double TM;
int a;
printf("please input the degree Fahrenheit:");
a = scanf("%lf",&TM);
while(a == 1)
{
Temperatures(TM);
printf("please input the degree Fahrenheit(q to quit):");
a = scanf("%lf",&TM); } return 0;
}
void Temperatures(double TM)
{
double celsius,kelvin;
celsius = (TM-A) / K;
kelvin = celsius + B;
printf("Fahrenheit:%.2lf, Celsius:%.2lf, Kelvin:%.2lf\n",TM,celsius,kelvin);
}
一个温度转化程序