暴力解法(我是第一个用Python的)
2026-03-07 20:14:02
发布于:浙江
1阅读
0回复
0点赞
也许不太像题目本身的意思,但能AC就好:
s=input()
a,b,c,d=s.split()
a=float(a)
b=float(b)
c=float(c)
d=float(d)
def f(x):
return a*x**3+b*x**2+c*x+d
i=-100
cnt=0
while i<100:
if cnt>2:
break
if abs(f(i))<0.0001:
print(f"{i:.2f}",end=' ')
cnt+=1
i+=0.01
这里空空如也







有帮助,赞一个