新手 求指教
//局部变量和参数的用法
#include <iostream>
float Convert(float);
int main()
{
using namespace std;
float TempFer;
float TempCel;
cout<<"Pleease enter the temperature in Fahrenheit:";
cin>>TempFer;
TempCel=Convert(TempFer);
cout<<"\nThere's the temperature in Celsius;";
cout<<TempCel<<endl;
return 0;
}
float Concert(float TempFer)
{
float TempCel;
TempCel=((TempFer-32)*5)/9;
return TempCel;
} 怎么不能执行啊!!!说main主函数调用一个外部无法解析的命令 。。怎么回事 求指教
[解决办法]
#include <iostream>
float Convert(float);
int main()
{
using namespace std;
float TempFer;
float TempCel;
cout<<"Pleease enter the temperature in Fahrenheit:";
cin>>TempFer;
TempCel=Convert(TempFer);
cout<<"\nThere's the temperature in Celsius;";
cout<<TempCel<<endl;
return 0;
}
float Convert(float TempFer)
{
float TempCel;
TempCel=((TempFer-32)*5)/9;
return TempCel;
}
稍作修改,可以编译运行了。