Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var p,q,d,x1,x2:real;
- begin
- p:=strtofloat(ed_p.text);
- q:=strtofloat(ed_q.text);
- d:=(p*p)/4 - q;
- if d<0 then
- showmessage('Keine Lösung')
- else if d=0 then
- begin
- x1:=-p/2;
- showmessage(concat('x= ',floattostr(x1)));
- end
- else
- begin
- x1:=-p/2+d;
- x2:=-p/2-d;
- showmessage(concat('x1= ',floattostr(x1)));
- showmessage(concat('x2= ',floattostr(x2)));
- end
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement