Heqy  
while True:
  a = input('1:摄氏度转华氏\n2 :华氏转摄氏\n3 :退出\n')
  if a =='1':
    f = input('请输入华氏温度:')
    c = 5/9*(float(f)-32)
    print('{}华氏温度转为摄氏温度为:{:.2f}'.format(f,c))
  elif a =='2':
    c = float(input('输入摄氏温度:'))
    f = c*9/5+32
    print('{:.2f}摄氏温度转为华氏温度{:.2f}'.format(c,f))
  else:
    break

posted on 2018-04-23 16:49  Heqy  阅读(279)  评论(0)    收藏  举报