Skip to content

Instantly share code, notes, and snippets.

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