Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a, b, c, d, x1, x2: real;
- begin
- writeln ('ax2+bx+c=0');
- write ('a=');
- readln (a);
- write ('b=');
- readln (b);
- write ('c=');
- readln (c);
- d := (b*b)+(4*a*c);
- if (a = 0) then
- write ('Уравнение не является квадратным.')
- else
- if (d > 0) then
- d:= sqrt(d);
- x1 := (-b+d)/2;
- x2 := (-b-d)/2;
- write ('x1=', x1, 'x2=', x2);
- else
- if (d = 0) then
- x1 := (-b-d)/2
- write ('Единственный x=', x1)
- else
- write ('Корней нет');
- end.
Add Comment
Please, Sign In to add comment