Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program ср1;
- uses
- System.SysUtils;
- var
- a, b, c, d, x, x1, x2: real;
- begin
- a := 0;
- b := 0;
- c := 0;
- x := 0;
- x1 := 0;
- x2 := 0;
- writeln('a, b, c');
- readln(a, b, c);
- d := b * b - 4 * a * c;
- if (a = 0) then
- writeln('no')
- else if (d < 0) then
- writeln('no')
- else if (d = 0) then
- begin
- x := -b / (2 * a);
- writeln('x =', x);
- end
- else
- begin
- x1 := (-b + sqrt(d)) / (2 * a);
- x2 := (-b - sqrt(d)) / (2 * a);
- writeln('x1 =', x1);
- writeln('x2 =', x2);
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement