while True: a = int(input(‘摄氏转华氏按1\n 华氏转摄氏按2\n退出请按3\n‘)) if a ==1: c = float(input(‘请输入摄氏度‘)) f = c*9/5+32 print(‘{:.2f}摄氏温度转化为华氏温度{:.2f}\n‘.format(c,f)) elif a==2: f = float(input(‘请输入华氏温度: ‘)) c = 5/9*(f-32) print(‘{:.2f}摄氏温度转化为华氏温度{:.2f}\n‘.format(f,c)) else: break
原文地址:https://www.cnblogs.com/guangzhoushangxueyuan121/p/8947447.html
时间: 2024-10-08 15:38:58