Advertisement
dream_4ild

9-И-3 ex.3

Jan 24th, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. a,b,c,d,f=map(int, input().split())
  2. i=1
  3. ans=0
  4. while (ans<5) and (i<100000):
  5.     if ((i**5) + a*(i**4) + b*(i**3) + c*(i**2) + d*i + f)==0:
  6.         print(i)
  7.         ans+=1
  8.     elif ((-i)**5 + a*(i**4) + b*((-i)**3) + c*(i**2) + d*(-i) + f)==0:
  9.         print(-i)
  10.         ans+=1
  11.     i+=1
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement