Discuss / Python / 还以为可以直接用b^2

还以为可以直接用b^2

Topic source

遥望PK

#1 Created at ... [Delete] [Delete and Lock User]

print(move(100,100,60,math.pi/6))

import math

def quadratic(a,b,c):

if pow(b,2)-4*a*c<0:

print('无实数解')                

else:

x1=(-b+math.sqrt(pow(b,2)-4*a*c))/2*a

x2=(-b-math.sqrt(pow(b,2)-4*a*c))/2*a

return x1,x2

print(quadratic(1,2,1))


  • 1

Reply