import math
import easygui as eg
eg.msgbox("This program solves quadratic equations Enter the values of a, b and c ")
a=eg.integerbox("enter a")
当我尝试输入负数或超过 99 的数字时,整数框不会让我,有什么办法可以解决这个问题
b=eg.integerbox("enter b")
c=eg.integerbox("enter c")
i = b**2-4*a*c
if d < 0:
eg.msgbox("There are no real solutions")
elif i == 0:
x = (-b+math.sqrt(i))/(2*a)
eg.msgbox("heres your solution: "), x
else:
x1 = (-b+math.sqrt(i))/(2*a)
x2 = (-b-math.sqrt(i))/(2*a)
eg.enterbox(msg="you have 2 solutions", default=(x1,x2))