#include <stdio.h>
void Temperatures(float n);
int main()
{
double n,flag;
printf(“Enter the temperature:\n”);
flag=scanf("%lf",&n);
while(flag==1)
{
Temperatures(n);
printf(“Enter the temperature:\n”);
flag=scanf("%lf",&n);
}
printf(“over”);
return 0;
}
void Temperatures(float n)
{
const float A = 5.0;
const float B=9.0;
const float C=32.0;
const float D=273.16;
float k,s;
s=A/B*(n-C);
k=s+D;
printf(“华氏温度为:%.2f摄氏温度为:%.2f开式温度为:%.2f\n”,n,s,k);
}
C Primer Plus第六版编程练习5.9
最新推荐文章于 2024-09-01 10:57:33 发布