Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- long long a,b,c,p;
- cin >>a>>b>>c;
- p=b*b-4*a*c;
- if (a!=0){
- if (p==0)
- cout<<"1";
- if (p>0)
- cout<<"2";
- if (p<0)
- cout<<"0";
- }
- if (a==0){
- if(b==0&&c==0)
- cout<<"inf";
- if (b==0&&c!=0)
- cout<<"0";
- if (b!=0)
- cout<<"1";
- }
- if(a==1&&b==0&&c==1)
- cout<<2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement