我需要一些帮助,用于将华氏温度转换为C摄氏温度的程序.我的代码看起来像这样
#include <stdio.h>
int main(void)
{
int fahrenheit;
double celsius;
printf("Enter the temperature in degrees fahrenheit:\n\n\n\n");
scanf("%d", &fahrenheit);
celsius = (5 / 9) * (fahrenheit - 32);
printf("The converted temperature is %lf\n", celsius);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
每次执行它时,结果为0.000000.我知道我错过了什么,但无法弄清楚是什么.
c ×1