Teo_Yanchev

combinations_nested_while

Jul 13th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. n = int(input())
  2. count = 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. count += 1
  8. print(count)
Advertisement
Add Comment
Please, Sign In to add comment