Advertisement
1nikitas

FIXTEH_9

Aug 31st, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. cnt = 0
  2. for i in range(-5000,5000):
  3.     a = i
  4.  
  5.     aa = (a*a + a + 1);
  6.     bb = (9*a + 2);
  7.     cc = (5*a - 7);
  8.  
  9.  
  10.     x1 = (-bb - (bb * bb - 4 * aa * cc)**0.5)/(2 * aa)
  11.     x2 = (-bb + (bb * bb - 4 * aa * cc)**0.5)/(2 * aa)
  12.  
  13.     if ((abs(x1) > 1) and (abs(x2) < 1)):
  14.         cnt +=1
  15. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement