DiYane

Combinations 3/11

Aug 18th, 2021
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment