1913 - 温度转换
编一程序,将摄氏温度换为华氏温度。公式为:f=9/5*c+32。其中f为华氏温度,c是摄氏温度。
Input
一行:一个整数,表示温度c。
Output
一行:一个实数,表示华氏温度f。
Examples
Input
5
Output
41.00
Hint
注意:两个整型数据相除,除号表示整除。
Solution C++
#include<iostream> using namespace std; int main() { float c,f; cin>>c; f=9.0/5*c+32; cout.precision(2); cout.setf(ios::fixed); cout<<f<<endl; // system("pause"); return 0; }
Hint
注意:两个整型数据相除,除号表示整除。