//2.7_4.cpp 摄氏度转华摄氏度
# include <iostream>
using namespace std;
int Fahrenheit(int);
int main()
{
int Celsius=0;
cout<<"Please enter a Celaius value: ";
cin>>Celsius;
int Fah=Fahrenheit(Celsius);
cout<<Celsius<<" degree Celsius is "<<Fah<<" degree Fahrenheit.\n";
return 0;
}
int Fahrenheit(int n)
{
return 1.8*n+32;
}
/*
输出结果:
Please enter a Celaius value: 20
20 degree Celsius is 68 degree Fahrenheit.
Press any key to continue
*/
输入输出,函数声明