永发信息网

编程序,输入一个华氏温度,要求输出摄氏温度。公式为c=5/9(F-32)输出要有文字说明,取2位小数。

答案:2  悬赏:30  手机版
解决时间 2021-11-13 03:26
  • 提问者网友:辞取
  • 2021-11-12 05:09
编程序,输入一个华氏温度,要求输出摄氏温度。公式为c=5/9(F-32)输出要有文字说明,取2位小数。
最佳答案
  • 五星知识达人网友:怀裏藏嬌
  • 2021-11-12 06:03
华氏转摄氏公式:T ℉ = 1.8t℃ + 32
#include
int main()
{
float f,c;
printf("输入华氏温度:\n");
scanf("%f",&f);
c=(f-32)/1.8;
printf("对应的摄氏温度是:%5.2f\n",c);
}
全部回答
  • 1楼网友:梦中风几里
  • 2021-11-12 06:47
// 华氏温度与摄氏温度对照表

#include
#include

int main()
{
float fahr = 0,cels = 0;
int low = 0,max = 300,step = 20;

printf ("\t=========本程序输出华氏和摄氏的温度对照!==========\n\t2006-12-30\n");

fahr = low;
printf ("\n\n华氏温度: 摄氏温度:\n-------- --------\n");
for (;fahr <= max;)
{
cels = 5.0 / 9.0 * (fahr - 12);
printf ("%.0f\t\t %6.2f\n",fahr,cels);
fahr += step;
}
system("pause");
return 0;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯