1913 - 温度转换

通过次数

0

提交次数

0

时间限制 : 1 秒 内存限制 : 128 MB
编一程序,将摄氏温度换为华氏温度。公式为:f=9/5*c+32。其中f为华氏温度,c是摄氏温度。

题目输入

一行:一个整数,表示温度c。

题目输出

一行:一个实数,表示华氏温度f。

输入/输出样例

输入格式

5

输出格式

41.00

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;
}

Python解答

# coding=utf-8
c=int(input())
print('%0.2f'%(9/5*c+32))