Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program num1;
- var a,b,c,d,x1,x2,x,w:real;
- begin
- write ('a=');
- read (a);
- write('b=');
- read (b);
- write ('c=');
- read (c);
- d:=sqr(b)-(4*a*c);
- write ('d=',d:4:2);
- w:=sqrt(d);
- writeln (' Корень из дискриминанта ',w:4:2);
- if d>0
- then
- begin
- x1:=((-b)+w)/(2*a);
- x2:=((-b)-w)/(2*a);
- writeln ('x1=',x1:4:2);
- writeln ('x2=',x2:4:2);
- end
- else
- if d=0
- then
- begin
- x:=(-b)/(2*a);
- writeln ('x=',x:4:2);
- end
- else if d<0
- then
- writeln (' нет корней');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement