Advertisement
denvolf2000

Задача 4

Dec 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. from random import randint
  2.  
  3. A =  [randint(-100, 100) for i in range(25)]
  4. print(A) #для проверки
  5.  
  6. count = 0
  7. countMax = -1
  8.  
  9. for i in range(len(A)):
  10.     if A[i] > 0:
  11.         count += 1
  12.     else:
  13.         if countMax < count:
  14.             countMax = count
  15.             count = 0
  16.         else:
  17.             count = 0
  18. print(countMax)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement