c++【入门】温度转换说明编一程序将摄氏温度换为华氏温度。公式为:f=95c+32。其中f为华氏温度c是摄氏温度。5212输入格式输入一行只有一个整数c输出格式输出只有一行包括1个实数。保留两位小数
#include <iostream>
#include <iomanip>
int main() {
int c;
std::cin >> c;
double f = 9.0 / 5 * c + 32;
std::cout << std::fixed << std::setprecision(2) << f << std::endl;
return 0;
}
原文地址: http://www.cveoy.top/t/topic/h6BW 著作权归作者所有。请勿转载和采集!