c语言输入一个华氏温度,转换输出摄氏温度.转换公式为:
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/20 03:03:05
![c语言输入一个华氏温度,转换输出摄氏温度.转换公式为:](/uploads/image/f/532293-69-3.jpg?t=c%E8%AF%AD%E8%A8%80%E8%BE%93%E5%85%A5%E4%B8%80%E4%B8%AA%E5%8D%8E%E6%B0%8F%E6%B8%A9%E5%BA%A6%2C%E8%BD%AC%E6%8D%A2%E8%BE%93%E5%87%BA%E6%91%84%E6%B0%8F%E6%B8%A9%E5%BA%A6.%E8%BD%AC%E6%8D%A2%E5%85%AC%E5%BC%8F%E4%B8%BA%3A)
因为你定义的变量是float类型,而如果输入5和9的话,电脑会认为是两个整形数据先相除,然后再转换成float型,所以就变成0了.
intmain(){floatc,f;printf("pleaseinputthef=");scanf("%f",&f);c=5/9*(f-32);printf("thec=%f",c);}再问:你运
#includevoidmain(){floatc,f;scanf("%f",&f);c=5.0/9*(e-32);printf("%f",c);}
代码#includevoidmain(){doublea,c;scanf("%lf",&a);c=9.0/5*(a-32);printf("%.2lf\n",c);}
摄氏温度与华氏温度的换算式是:摄氏温度,冰点时温度为0摄氏度,沸点为100摄氏度而华氏温度把冰点温度定为32华氏度,沸点为212华氏度所以1摄氏度等于1.8华氏度摄氏温度与华氏温度的换算式是:5(F-
用这个程序可以实现#includefloatchange(floatx);voidmain(){floatfahr;printf("请输入摄氏温度:");scanf("%f",&fahr);print
#includevoidmain(){floatc,f;printf(“请输入一个华氏温度:”)scanf(“%f”,&f);c=(f-32)/9;printf(“摄氏温度为:%5.2f\n”);}编
includeintmain(){floatfahr,celsius;scanf("%f",&fahr);celsius=5.0*(fahr-32)/9;printf("fahr=%.6f",fahr
#includeintmain(){inti,n,m;scanf("%d%d",&n,&m);if(n>m){intt=n;n=m;m=t;}printf("fahrcelsius\n");for(i
#includemain(){floatc,h;while(1){printf("PleaseinputtheC:");scanf("%f",&c);if(c!=0){printf("TheHis:%
#includevoidmain(){floatF;floatC;scanf("%f",&F);printf("%f",C=5/9*(F-32);}采纳吧少年,这题我们刚做过
#includevoidmain(){floatf;scanf("%f",&f);printf("%f",(f-32)*5/9);}
1.#includeintsheshi(floatfw){floatsw;sw=(5.0/9.0)*(fw-32);printf("thecentigradetemperatureis:%f",sw)
#includeintmain(){floatf,c;//f表示华氏温度,c表示摄氏温度printf("请输入华氏温度:\n");scanf("%f",&f);c=f-273.5;//额你给的公式好像
#includemain(){floatf,c;printf("pleaseenterF:");scanf("%f",&f);c=5.0*(f-32.0)/9.0printf("%f",c);}
#include<stdio.h>int main(){ float F,c; &nbs
#includevoidmain(){intc;floatF;printf("C\tF");for(c=0;c
#includeintmain(){floatF,c;while(1){printf("请输入华氏温度:");scanf("%f",&F);c=5*(F-32)/9;printf("摄氏温度为:%0.
华氏温度与摄氏温度的转换,可以运用公式C=5/9(F-32)来求得.如果已知F=4102,那么,转换成摄氏温度是多少呢?其求解步骤为: