小白一个,有没有大神能告诉我哪错了,求

华氏温度与摄氏温度相互转换

根据转换公式:

 摄氏温度  = 5 (华氏温度-32) / 9 

 让用户输入华氏温度,求出摄氏温度

例如:

输入:45

输出:华氏温度:45.00 = 摄氏温度:7.22

 

输入:58

输出:华氏温度:58.00 = 摄氏温度:14.44

 

#include <stdio.h>

int main()
{
float a,b,c,d,e;
	c=5,d=32,e=9;
	scanf("%f",&a);
	b=c*(a-d)/e;
	printf("华氏温度:%.2f,摄氏温度:%.2f\n",a,b);
	return 0;
}

把double改成int试试

#include "stdio.h"

int main()

{

        float a,b,c,d,e;

        c=5,d=32,e=9;

        scanf("%f",&a);

        b = c *(a-d) / e;

        printf("华:%.2f,摄:%.2f",a,b);

        return 0;

}

 

 

函数最后return 0,定义的确是 double。

 

还是不对,我也不知道咋回事