输入华氏度,输出对应的摄氏度

已知华氏温度,将其转换为摄氏温度的公式为5/9*(f-32)。定义整形变量,输入一个华氏温度,输出对应的摄氏温度。(c++程)

有帮助望采纳~

#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int input;
    cin >> input;
    float output = 5.0 / 9 * (input - 32);
    cout << output << endl;
    return 0;
}