答案就是错排数
n = int(input())
f = [0] * 205
f[0] = 1
for i in range(2, n+1):
f[i] = (i-1) * (f[i-1] + f[i-2])
print(f[n])
答案就是错排数
n = int(input())
f = [0] * 205
f[0] = 1
for i in range(2, n+1):
f[i] = (i-1) * (f[i-1] + f[i-2])
print(f[n])
转载于:https://www.cnblogs.com/poorpool/p/9001731.html