Advertisement
1nikitas

Untitled

Oct 22nd, 2021
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. n = int(input())
  2. mas = [int(i) for i in input().split()]
  3.  
  4. pr = 1
  5. sum = 0
  6.  
  7. for i in range(n):
  8. if mas[i] < 0 and mas[i] % 3 == 0:
  9. pr = pr* mas[i]
  10. if mas[i] > 0 and mas[i] % 7 == 0:
  11. sum = sum + mas[i]
  12.  
  13. if pr == 1:
  14. print("отрицательных + кратных 3 не было ")
  15. elif sum == 0:
  16. print("положительных + кратных 7 не было")
  17. else:
  18. print(pr,sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement