1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| program cool;
uses wincrt;
var
a,b,c:integer;
D:real;
begin
write('a= ');readln(a);
write('b= ');readln(b);
write('c= ');readln(c);
D:=b*b-4*a*c;
if a=0 then
begin
if b=0 then
begin
if c=0 then
writeln('Solution: ensemble R')
else
writeln('Pas de solution');
end
else
writeln('Solution: ',(-c/b):5:3);
end
else
begin
if D<0 then writeln('Pas de solution');
if D=0 then writeln('Solution 1: ',-b/(2*a):5:3);
if D>0 then writeln('Solution 1: ',(-b-sqrt(D))/(2*a):5:3,'||| Solution 2: ',(-b+sqrt(D))/(2*a):5:3);
end;
end. |