c语言编程问题,求解,谢谢我写的代码错了,也有可能我没看懂题目,这个题目就是这样

2025-02-11 09:40:01
推荐回答(2个)
回答1:

#include
#include
#define SIZE 50
#define x 32
#define y 9
#define z 5
float ctof(float F,float c)
{
F= x+c*y/z;
return (F);
}
int main(void)
{
float F=0, c;
for(c=-1000; c<=1500;c+=SIZE)
{
ctof(F,c);
printf("%12.4f℃ %12.4fF\n", c, ctof(F,c));

}

system("pause");
return 0;
}

回答2:

把函数从整形换为浮点型试试