desislava_topuzakova

03. Combinations

Oct 21st, 2020
758
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. counter = 0
  3. for x1 in range(0, n+1):
  4.     for x2 in range(0, n+1):
  5.         for x3 in range(0, n+1):
  6.             if x1 + x2 + x3 == n:
  7.                 counter += 1
  8. print(counter)
RAW Paste Data