Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. long long a,b,c,p;
  5. cin >>a>>b>>c;
  6. p=b*b-4*a*c;
  7. if (a!=0){
  8. if (p==0)
  9. cout<<"1";
  10. if (p>0)
  11. cout<<"2";
  12. if (p<0)
  13. cout<<"0";
  14.  
  15. }
  16. if (a==0){
  17. if(b==0&&c==0)
  18. cout<<"inf";
  19. if (b==0&&c!=0)
  20. cout<<"0";
  21. if (b!=0)
  22. cout<<"1";
  23. }
  24. if(a==1&&b==0&&c==1)
  25. cout<<2;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement