这是一个将华氏温度转化为摄氏温度的函数,为什么输出华氏温度后,输出的摄氏温度值一直为0呢?
#include<iostream>
#include<cstdlib>
using namespace std;
int ftoc(int f)
{
int c;
c = (5 / 9 * (f - 32));
return c;
}
int main()
{
int fahr;
int celi;
cout << "please enter the fahr: ";
cin >> fahr;
celi = ftoc(fahr);
cout << "the celi is: " << celi << endl;
system("pause");
return 0;
}