Created
April 26, 2023 11:14
-
-
Save modos/a0061e96877e58eb03d3f3b6e1d4d68f to your computer and use it in GitHub Desktop.
شمارش مثلثها ۲
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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