fork download
  1. def main():
  2. arr = [9,8,7,6,5,4,3,2,-11]
  3. print(arr)
  4. n = len(arr)
  5. i = 1
  6. while i < n and arr[i] == arr[0]:
  7. i +=1
  8. if i < n:
  9. if arr[i - 1] < arr[ i ]:
  10. flag = True
  11. for j in range(i , n - 1):
  12. if arr[j] > arr[j+1]:
  13. flag = False
  14. if flag is True:
  15. print("Vector crescator!")
  16. else:
  17. print("Vector neordonat!")
  18.  
  19. elif arr[i - 1] > arr[ i ]:
  20. flag = True
  21. for j in range(i, n - 1):
  22. if arr[j] < arr[j+1]:
  23. flag = False
  24. if flag is True:
  25. print("Vector descrescator!")
  26. else:
  27. print("Vector neordonat!")
  28. else:
  29. print("Constant Vector!")
  30.  
  31. main()
Success #stdin #stdout 0.03s 9020KB
stdin
Standard input is empty
stdout
[9, 8, 7, 6, 5, 4, 3, 2, -11]
Vector descrescator!