Guest User

Untitled

a guest
Jan 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var a, b, c, d, x1, x2: real;
  2. begin
  3. writeln ('ax2+bx+c=0');
  4. write ('a=');
  5. readln (a);
  6. write ('b=');
  7. readln (b);
  8. write ('c=');
  9. readln (c);
  10. d := (b*b)+(4*a*c);
  11. if (a = 0) then
  12. write ('Уравнение не является квадратным.')
  13. else
  14. if (d > 0) then
  15. d:= sqrt(d);
  16. x1 := (-b+d)/2;
  17. x2 := (-b-d)/2;
  18. write ('x1=', x1, 'x2=', x2);
  19. else
  20. if (d = 0) then
  21. x1 := (-b-d)/2
  22. write ('Единственный x=', x1)
  23. else
  24. write ('Корней нет');
  25. end.
Add Comment
Please, Sign In to add comment