練習問題

a = 'abcdefghijklmnopqrstuvwxyz .,-'
s = 'qdq-gi.q-a ziatmxxitmdqibtqi-ustbi ri.qmoqrcxi.qbubu zir -ibtqi-qp-qaai ripmymsqkir -ibtqi-qy dmxi ri.cnxuoi rruoumxakir -ibtqiqzmobyqzbkii-q.qmxi -imyqzpyqzbi rixmeaki -puzmzoqai -i-qscxmbu zaimzpir -i btq-iymbbq-a;iz -iatmxximzgi.q-a zinqiuzimzgiemgipuao-uyuzmbqpimsmuzabir -ia. za -uzsiacotiimi.qbubu zj'
for i in xrange(1, len(a)):
  candidate = ''
  for e in s:
    if e == ';':
      candidate += ';'
    else:
      candidate += a[(a.find(e) + i) % len(a)]
  if 'person' in candidate:
    print candidate
    break

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS