聪明的小羊

链接:http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=52

描述:

一只小羊跳过了栅栏,两只小样跳过了栅栏,一坨小羊跳过了栅栏...

tn c0afsiwal kes,hwit1r  g,npt  ttessfu}ua u  hmqik e {m,  n huiouosarwCniibecesnren.

 直接上代码:python3.5

result = {0:'',1:'',2:'',3:'',4:'',5:'',6:'',7:'',8:'',9:'',10:'',11:'',12:'',13:'',14:'',15:'',16:''}
b = 17
s = "tn c0afsiwal kes,hwit1r  g,npt  ttessfu}ua u  hmqik e {m,  n huiouosarwCniibecesnren."
for i in range(len(s)):
    a = i % b
    result.update({a:result[a]+s[i]}) #updata函数把字典dict2的键/值对更新到dict里
for i in range(b):
    print(result[i])


the a
nwser
 is w
ctf{C
01umn
ar},i
f u i
s a b
ig ne
w,u c
an he
lp us
 thin
k mor
e que
stion
,tks.
原文地址:https://www.cnblogs.com/Jdrops/p/ctf-python3.html