Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- n = 50
- sum = 0
- count = 0
- d = 0
- a = [randint(0,10000) for i in range(n)]
- max = 0
- min = 10001
- for i in range(len(a)):
- if a[i] % 2 == 0:
- d += 1
- if a[i] % 3 == 0:
- d += 1
- if a[i] % 5 == 0:
- d += 1
- if a[i] % 7 == 0:
- d += 1
- if d == 2:
- count += 1
- if a[i] > max:
- max = a[i]
- if a[i] < min:
- min = a[i]
- else:
- d = 0
- print("Количество:", count)
- sum = min + max
- print("Сумма минимального и максимального:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement