Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a,b,c,d,i;
  9. cin >> a;
  10. cin >> b;
  11. cin >> c;
  12. cin >> d;
  13. for(i=-3000;i<=3000;i++)
  14. {
  15. if((a*pow(i,3))+(b*pow(i,2))+c*i+d==0)
  16. {
  17. cout << i;
  18. }
  19.  
  20. }
  21.  
  22.  
  23. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement