8 lines
351 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

方法1穷举法从小到大求出所有的根见equ.pas。
方法2:用随机化算法随意地产生一个根,然后用韦达定理(x1+x2+x3=-b/a,x1x2+x1x3+x2x3=c/a)求出另外的二个根见equ1.pas。
方法3:随机产生x1和x2使得f(x1)*f(x2)<0,再用迭代法求出区间[min(x1,x2),max(x1,x2)]上的一个根,然后用韦达定理求出另外的二个根。
方法4:用穷举法求得其中的一个根,然后用韦达定理求出另外的二个根。