반응형

1. 내가 푼 풀이

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
problem = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.";
temp=[]
 
for i in range(0,len(problem)):
 
    if(ord(problem[i])>96):
        if(ord(problem[i]))>120:
            temp.insert(i, chr(ord(problem[i])-24))
            #temp.insert(i, 'a')
        else:
            temp.insert(i, chr(ord(problem[i]) + 2))
    else:
        temp.insert(i,problem[i])
 
#print(temp)
result = ''.join(temp)
 
print(result)



cs


result : i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url.


2. 추천받은 풀이

1
2
3
4
5
6
7
8
9
import string
 
problem = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.";
temp=[]
 
before='abcdefghijklmnopqrstuvwxyz'
after='cdefghijklmnopqrstuvwxyzab'
sen=problem.maketrans(before,after)
print(problem.translate(sen))


cs


result : i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() 

is recommended. now apply on the url.


비고) 와... 훨씬 편하네


답 : ocr.html

반응형

'Solve Problem' 카테고리의 다른 글

[SuNiNaTas] 23번 문제  (0) 2019.01.21
[PythonChallenge] 3번 문제  (0) 2018.09.02
[PythonChallenge] 1번  (0) 2018.09.02
[SuNiNaTaS] 8번 문제  (0) 2018.05.10
[SuNiNaTaS] 7번 문제  (0) 2018.05.10
블로그 이미지

rootable

,