IS ANYBODY HERE?
我是VFP初学者,求助各位老师判断奇偶数的程序怎么写,还有a*x ^2+b*x+c=0这个用IF ELSE,不用DO CASE,
紧急,,,,万分感谢,,
input "A=" to A
input "B=" to B
input "C=" to c
if a=0
if b=0
?"方程无意义!"
else
x=-c/b
?"x=",x
endif
else
d=b*b-4*a*c
if d>=0
x1=(-b+sqrt(d))/(2*A)
X2=(-b-sqrt(d))/(2*A)
?"x1=",x1,"x2=",x2
else
S=-b/(2*A)
XU=sqrt(-d)/(2*A)
?"x1=",s,"+",xu,"i"
?"x2=",s,"-",xu,"i"
endif
endif
[此贴子已经被作者于2006-4-8 9:06:34编辑过]