Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # a = [1, 2, 1, 3, 4, 5, 6, 2]
- #a = [5, 4, 3, 2, 1, 6, 7, 7, 8, 9, 9, 10, 11, 11]
- a = []
- flag = True
- while True:
- new_element = int(input())
- if new_element == 0:
- break
- a.append(new_element)
- max = 1
- count = 1
- for index in range(len(a) - 1):
- if a[index + 1] > a[index]:
- count += 1
- if (index + 1) == len(a) - 1:
- max = count
- else:
- if count > max:
- max = count
- count = 1
- count = 1
- for index in range(len(a) - 1):
- if a[index + 1] < a[index]:
- count += 1
- if (index + 1) == len(a) - 1:
- max = count
- else:
- if max < count:
- max = count
- count = 1
- print(max)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement