Re: 废文

楼主: zoeredbird (柔依‧红鸟)   2023-11-22 17:51:30
差不多应该可以算是同一个系列的
from scipy import integrate
n = int(input("最高次方: "))
# 设定积分范围
a = int(input("积分下限: ")) # 积分下限
b = int(input("积分上限: ")) # 积分上限
# 定义要积分的函数
def f(x):
if n - 1 <= 0:
return 0
else:
return x ** n
# 计算积分
result, error = integrate.quad(f, a, b)
# 显示积分结果
print(f"积分结果: {result}")
作者: scmono (摸诺)   2023-11-22 17:52:00
这三小

Links booklink

Contact Us: admin [ a t ] ucptt.com