#摄氏℃=5/9  (°F-32)

#1.输入
f=float(input('请输入华氏温度:'))

#2.计算
c=5/9*(f-32)

#3.输出
print('{:.2f}华氏温度转换为摄氏温度为;{:.2f}'.format(f,c))
#用户输入摄氏温度
   celsius=float(input('输入摄氏温度:'))

   #计算华氏温度
   fahrenheit=(celsius*9/5)+32    #f=c*9/5+32

   #向用户输出华氏温度
   print('{:.2f}摄氏温度转为华氏温度为{:.2f}'.format(celsius,fahrenheit))

 

posted on 2018-04-23 15:51  木匀……  阅读(93)  评论(0)    收藏  举报