题解 | #杨辉三角的变形#
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
n = int(input())
# 找规律就可以,不用想得太复杂
if (n <= 2):
print(-1)
elif ((n - 3) % 2 == 0):
print(2)
elif ((n - 3) % 4 == 1):
print(3)
else:
print(4)
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
n = int(input())
# 找规律就可以,不用想得太复杂
if (n <= 2):
print(-1)
elif ((n - 3) % 2 == 0):
print(2)
elif ((n - 3) % 4 == 1):
print(3)
else:
print(4)
相关推荐
查看12道真题和解析