fork download
  1. #include<iostream>
  2. #include<bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double a,b,c;
  9. cin>>a>>b>>c;
  10. if(a!=0)
  11. {
  12. if(pow(b,2)-4*a*c==0)
  13. cout<<((-b-sqrt(pow(b,2)-4*a*c))/2*a)<<endl;
  14. if(pow(b,2)-4*a*c<0)
  15. cout<<"brak"<<endl;
  16. if(pow(b,2)-4*a*c>0)
  17. cout<<((-b-sqrt(pow(b,2)-4*a*c))/2*a)<<' '<<((-b+sqrt(pow(b,2)-4*a*c))/2*a)<<endl;
  18. }
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
-0