fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. double a, b, c, d; int ile;
  6.  
  7. int main()
  8. {
  9.  
  10. cin>>ile;
  11. for(float i=1; i<=ile; i++)
  12. {
  13.  
  14.  
  15.  
  16. cin>>a>>b>>c;
  17.  
  18. d=(b*b)-(4*a*c);
  19.  
  20. if(d==0)
  21. {
  22. cout<<1<<endl;
  23. }
  24.  
  25.  
  26. if (d>0)
  27. {
  28. cout<<2<<endl;
  29. }
  30.  
  31. if (d<0)
  32. {
  33. cout<<0<<endl;
  34. }
  35.  
  36. }
  37.  
  38. return 0;
  39. }
Success #stdin #stdout 0.02s 4792KB
stdin
0.3 0.3 0.4
0.5 1 0.5
-0.5 -0.5 0
stdout
Standard output is empty