📄 hour05_2.cpp
字号:
#include <iostream>
// this is actually a very simple problem -- change the names around and reverse
// the formula!
float Convert(float);
int main()
{
float TempFer;
float TempCel;
std::cout << "Please enter the temperature in Celsius: ";
std::cin >> TempCel;
TempFer = Convert(TempCel);
std::cout << "\nHere's the temperature in Fahrenheit: ";
std::cout << TempFer << std::endl;
return 0;
}
float Convert(float TempCel)
{
float TempFer;
TempFer = TempCel * 9 / 5 + 32;
return TempFer;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -