Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n1 = int(input())
- n2 = int(input())
- magic_num = int(input())
- combination = 0
- for first in range(n1, n2 + 1):
- for second in range(n1, n2 + 1):
- combination += 1
- if first + second == magic_num:
- break
- if first + second == magic_num:
- break
- if first + second != magic_num:
- print(f'{combination} combinations - neither equals {magic_num}')
- else:
- print(f'Combination N:{combination} ({n1} + {n2} = {magic_num})')
Advertisement
Add Comment
Please, Sign In to add comment