Python/2.7 simple coding(+ c++)

파이썬챌린지.com 4

qkqhxla1 2014. 8. 15. 18:28



http://www.pythonchallenge.com/pc/def/linkedlist.php

? 아무것도 없고 사진 클릭하면 and the next nothing is 44827 이 나옵니다.

url은 http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345 이고요.

그럼 바꿔봐서 http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=44827 로 들어가봅시다.

and the next nothing is 45439 가 나옵니다. 한번 더 숫자써보면 너 손아플꺼야.. 라고 나옵니다.

노가다문제네요. 파이썬으로 짜면.

파이썬으로 짤 시에 항상 is뒤에 숫자가 나오는걸 감안해서 is뒤의 값을 숫자로 변환해서

처리했습니다. is가 없으면 종료되게도 하고요.

# -*- coding: euc-kr -*-
import urllib2
number = 12345

while 1:
    req = urllib2.Request('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='+str(number))
    res = urllib2.urlopen(req)
    reads = res.read()
    print reads
    if reads.find('is') == -1:
        break
    number = int(reads[reads.find('is')+3:])

16044를 2로 나눈뒤에 계속하라고 합니다. 올 끝?? 인줄 알았지만 8022를 입력하면 다시 시작입니다.

number의 초기값만 8022로 바꿔서 돌려봅시다.




뭔가 에러가 뜨긴 하지만 이전까지는 잘 진행했습니다. 무슨 오해?를한다고 하네... 블라블라

어쨋든 해석해보면 next nothing is 63579에서 다음 숫자는 또 63579라는걸 알수있습니다.

기초값만 63579로 바꾸고 또 돌리면.


peak.html

'Python > 2.7 simple coding(+ c++)' 카테고리의 다른 글

wargame.kr pw_crack  (2) 2014.10.06
파이썬챌린지.com 5  (0) 2014.08.16
파이썬챌린지.com 3  (0) 2014.08.15
파이썬챌린지.com 2  (0) 2014.08.15
파이썬챌린지.com 1  (1) 2014.08.15