a = float(input())
b = float(input())
c = float(input())
d = a + b + c
s = d / 2
area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
print(f"周长={d:.2f}")
print(f"面积={area:.2f}")
三角函数计算
import math
a = float(input())
b = float(input())
angle_degrees = 60
angle_radians = angle_degrees * (math.pi / 180)
x = ( -b + math.sqrt(2*a * math.sin(angle_radians)* math.cos(angle_radians))) / 2 / a
print(f"{x:.2f}")
表达式求值
import math
a=float(input())
b=float(input())
c=float(input())
s=(-b + math.sqrt(b**2 - 4 * a * c)) / 2 / a
print(f"{s:.2f}")
计算矩形面积
a=eval(input())
b=eval(input())
s=a*b
print(s)
换披萨
m = int(input())
n = int(input())
m_square_units = m * m
n_square_units = n * n
required_small_pizzas = m_square_units // n_square_units
if m_square_units % n_square_units != 0:
required_small_pizzas += 1
print(required_small_pizzas)
计算存款利息
P = int(input())
N = int(input())
i = float(input())
F = P * (1 + i) ** N
a = F - P
print(f"利息={a:.2f}")