Created
April 26, 2023 11:13
-
-
Save modos/0bcd56420be99538292310a26d96a00c 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()) | |
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