Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('2A.txt')
- A = list(map(int, file.readlines()))
- count = 0
- for i in range(len(A)):
- for j in range(i + 1, len(A)):
- if (A[i] * A[j]) % 7 == 0:
- count += 1
- print(count)
- file = open('2B.txt')
- B = list(map(int, file.readlines()))
- k7 = 0, 0
- for i in range(len(B)):
- if B[i] % 7 == 0:
- k7 += 1
- else:
- k += 1
- print((k7 * (k7 - 1) // 2) + (k * k7))
- #Проверка: в 13 и 14 строках B -> A
Advertisement
Add Comment
Please, Sign In to add comment