✔ 最佳答案
program quaratic_equation;
uses
wincrt;
var
a,b,c,d:longint;
begin
writeln('ax^2+bx+c=0');
write('Enter the number of a: ');
readln(a);
write('Enter the number of b: ');
readln(b);
write('Enter the number of c: ');
readln(c);
d:= b*b-4*a*c;
if d<0 then
writeln('No real roots')
else
begin
if d=0 then
writeln('The root is ',((-b+sqrt (d))/(2*a)):0:20,'(Repeated)');
if d>0 then
begin
writeln('the roots are:');
writeln((-b+sqrt (d))/(2*a):0:20);
writeln((-b-sqrt (d))/(2*a):0:20);
end
end
end.