SHARE
TWEET

xuy

a guest Oct 19th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program pchprr;
  2. var
  3. a,b,c,D,x1,x2:real;
  4.  
  5.  
  6. begin
  7. readln(a,b,c);
  8. if(a=0)and(b=0)and(c=0) then writeln('∞')
  9.  
  10. else
  11.    begin
  12.    if(a>=0) then
  13.    begin
  14.    D:=sqr(b)-4*a*c;
  15.    
  16.    if(D>=0) then
  17.       begin
  18.       x1:=(b*-1 + sqrt(D))/2*a;
  19.       writeln('x1=',x1);
  20.      
  21.       if(D<>0) then
  22.          begin
  23.          x2:=(b*-1 - sqrt(D))/2*a;
  24.          writeln('x2=',x2);
  25.          end;
  26.       end
  27.      
  28.    else
  29.       begin
  30.       writeln('no');
  31.       end;
  32.    end
  33.    
  34. else
  35.    begin
  36.    x1:=(c*-1)/b;
  37.    writeln('x=',x1);
  38.    end;
  39.  
  40.    end;
  41.  
  42. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top