Skip to content

Instantly share code, notes, and snippets.

@modos
Created April 26, 2023 11:14
Show Gist options
  • Save modos/a0061e96877e58eb03d3f3b6e1d4d68f to your computer and use it in GitHub Desktop.
Save modos/a0061e96877e58eb03d3f3b6e1d4d68f to your computer and use it in GitHub Desktop.
شمارش مثلث‌ها ۲
n = int(input())
answer = 0
for i in range(1, n+1):
for j in range(i, n-i+1):
k = n - i - j
if i + j > k and k >= j:
answer += 1
print(answer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment