Răspunsuri

2014-10-16T15:26:46+03:00
Program nume;
Uses crt;
var a,b,c,x1,x2,d : real;
Begin
clrscr;
Writeln('Introduceti datele');
Write('a = '); Readln(a);
Write('b = '); Readln(b);
Write('c = '); Readln(c);
d := sqr(b)-4*a*c;
if d<0 then writeln('Ecuatia nu are solutii.')
else begin
    if d=0 then x1:=-1*b/(2*a);
    else
    x1:=(-1*b-sqrt(d)) / (2*a);
    x2:=(-1*b+sqrt(d)) / (2*a);
     end;
Writeln('x1 = ',x1);
Writeln('x2 = ',x2);
Writeln('Discriminanta = ',d);
Readkey;
End.