Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- mas = [int(i) for i in input().split()]
- pr = 1
- sum = 0
- for i in range(n):
- if mas[i] < 0 and mas[i] % 3 == 0:
- pr = pr* mas[i]
- if mas[i] > 0 and mas[i] % 7 == 0:
- sum = sum + mas[i]
- if pr == 1:
- print("отрицательных + кратных 3 не было ")
- elif sum == 0:
- print("положительных + кратных 7 не было")
- else:
- print(pr,sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement