a=float(input("请输入一个数:"))
print('{:.3f}'.format(a))

格式化输出_其他