Advertisement
Spocoman

03. Combinations

Dec 29th, 2021
110
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 i in range(n + 1):
  4.     for j in range(n + 1):
  5.         for k in range(n + 1):
  6.             if i + j + k == n:
  7.                 counter += 1
  8. print(counter)
  9.  
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement