Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- a = list(map(float, input().split()))
- f = 1
- amin = a.index(min(a))
- amax = a.index(max(a))
- for i in range(min(amin, amax) + 1, max(amin, amax)):
- f *= a[i]
- if abs(amin - amax) <= 1:
- print('0')
- else:
- print(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement