Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 09. Sum of Two Numbers
- startingNumber = int(input())
- finalNumber = int(input())
- magicNumber = int(input())
- combinations = 0
- i = 0
- for i in range(startingNumber, finalNumber):
- i += 1
- for j in range(startingNumber, finalNumber):
- j+=1
- combinations += 1
- if i + j == magicNumber:
- break
- print(f"Combination N:{combinations} ({i} + {j} = {magicNumber})")
- print(f"{combinations} combinations - neither equals {magicNumber}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement