python/2024-7-5-数的绝对值.py

6 lines
118 B
Python
Raw Normal View History

# 读取输入的浮点数
n = float(input())
# 计算并输出绝对值,保留两位小数
print(f"{abs(n):.2f}")