杨辉三角的变形
杨辉三角的变形
http://www.nowcoder.com/questionTerminal/8ef655edf42d4e08b44be4d777edbf43
1、先找规律:
-1 -1 (2 3 2 4) (2 3 2 4) (2 3 2 4) 循环
2、
def demo(temp): arr = [4, 2, 3, 2] if temp <= 2: return -1 return arr[(temp-2)%4] import sys for line in sys.stdin: a = line.split() for i in a: print(demo(int(i)))