Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- for(int kek=0;kek<n;kek++){
- double a,b,c;
- cin>>a>>b>>c;
- cout<<fixed<<showpoint;
- cout.precision(6);
- if(a)
- {
- double d=b*b-4*a*c;
- double ba=-b/(2.0*a);
- if(d>0)
- {
- double sd=sqrt(d)/(2.0*a);
- if (a>0)
- cout<<"2";
- else
- cout<<"2";
- }else if(d==0)
- cout<<"1";
- else
- cout<<"0";
- }else if(b)
- cout<<"1";
- else if(c)
- cout<<"0";
- else
- cout<<"-1";
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement