Professional Documents
Culture Documents
uses
dialogs,sysutils;
var
x,y,z,w:string;
a,b,c,d:integer;
x1,x2,x3:integer;
hallado:boolean;
s,k:string;
begin
x:=inputbox('Ingrese Numero','valorA','');
y:= inputbox('Ingrese Numero','valorB','');
z:= inputbox('Ingrese Numero','valorC','');
w:= inputbox('Ingrese Numero','valorD','');
a:=strtoint(x);
b:= strtoint(y);
c:= strtoint(z);
d:= strtoint(w);
hallado:=false;
s:='Las raices de nuesto polinomio
son:'+#13+#13+'x1'+#9+'x2'+#9+'x3'+#13;
k:=inttostr(a)+'*^3+'+inttostr(b)+'*x^2+'+inttostr(c)
+'*x+'+inttostr(d)+'=0'+#13+#13;
for x1:=100to 100do
for x2:=100 to 100 do
for x3:=100 to 100 do
if a*x1*x1*x1+b*x1*x1+c*x1+d=0 then
if a*x2*x2*x2+b*x2*x2+c*x2+d=0 then
if a*x3*x3*x3+b*x3*x3+c*x3+d=0 then
if (x1<>x2)and(x1<>x3)and(x2<>x3) then
begin
s:=k+s+inttostr(x1)+#9+inttostr(x2)+#9+inttostr(x3);
showmessage(s);
hallado:=true;
if hallado then
exit
end;
begin
hallado:=false;