s ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'for Name_1 in s:for Name_2 in s:for Name_3 in s:for Name_4 in s:
Name = Name_1 + Name_2 + Name_3 + Name_4
Serial =[]# 循环二:提取Name每一位得到v23,判断v23与第一段Serial是否相等for i inrange(len(Name)):
v23 =3*len(Name)-2*(i+1)-20+ord(Name[i])
Serial.append(v23)# 循环三:提取Name_reverse每一位计算得到v34,判断v34与第二段Serial是否相等
Name_reverse = Name[::-1]for i inrange(len(Name_reverse)):
v34 =ord(Name_reverse[i])+3*len(Name)-3*(i+1)-20
Serial.append(v34)# 循环四:将Name从小到大进行排序,得到Name_move
Name_move =[ord(i)for i in Name]
n =0while n ==0:
n =1for i inrange(3):if Name_move[i]> Name_move[i +1]:
k = Name_move[i]
Name_move[i]= Name_move[i +1]
Name_move[i +1]= k
n =0# 循环五:提取Name_move每一位计算得到v65,判断v65与第三段Serial是否相等for i inrange(len(Name_move)):
v65 = Name_move[i]+(len(Name)-3)*(len(Name)-3)-2*(i+1)-20
Serial.append(v65)
Serial ="".join([chr(i)for i in Serial])
n =0for i in Serial:if i in s:passelse:
n =1breakif n ==0:print(Name +'的Serial为:'+ Serial)