dim a ,b,c,x1,x2,d a =val(inputbox("请输入系数a")) b =val(inputbox("请输入系数b")) c =val(inputbox("请输入系数c")) d=b^2-4*a*cif d>0 then x1=(-b+sqr(d))/2x2=(-b-sqr(d))/2elseif d=0 thenx1=-b/2x2=x1else msgbox "方程无实根!"end if