Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1.  
  2. #f_in = open('connect.in', 'r')
  3. #f_out = open('connect.out', 'w')
  4. a, b = map(int, input().split())
  5. A = []
  6. count = 0
  7. if a + b not in A:
  8.     A.append(a + b)
  9.     count += 1
  10. if a - b not in A:
  11.     A.append(a - b)
  12.     count += 1
  13. if b - a not in A:
  14.     A.append(b - a)
  15.     count += 1
  16. if a * b not in A:
  17.     A.append(a * b)
  18.     count += 1
  19. if b != 0 and a / b not in A:
  20.     A.append(a / b)
  21.     count += 1
  22. if a != 0 and b / a not in A:
  23.     A.append(b / a)
  24.     count += 1
  25. if a != 0 or b > 0:
  26.     if a**b not in A:
  27.         A.append(a**b)
  28.         count += 1
  29. if b != 0 or a > 0:
  30.     if b**a not in A:
  31.         count += 1
  32. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement