每当我输入Temp时,Cel的值保持为零,为什么表达式不存储值呢?
#include<iostream>
using namespace std;
int main(){
float Far, Cel, Temp;
char choice;
cout << " To convert from Celcius to Farenheit, press 'f' for opposite 'c': "<<endl;
cin >> choice;
cout << "Enter Temperature: " << endl;
cin >> Temp;
if(choice == 'f' || choice == 'F'){
Far = (Temp*(9/5))+32;
cout << "Temperature in Farenheit is: " << Far << endl;
}
else if(choice == 'c' || choice == 'C'){
Cel = (Temp - 32) * (5/9);
cout << "Temperature in Celcius is: " << Cel << endl;
}
return 0;
}