pythonchallenge 【第1题】

 新博客地址:http://gorthon.sinaapp.com/

http://www.pythonchallenge.com/pc/def/274877906944.html

>>> a = "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." >>> table = string.maketrans('abcdefghijklmnopqrstuvwxyz', 'cdefghijklmnopqrstuvwxyzab') >>> string.translate(a, table) "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." >>>  

###################################################

C++版本:

#include <iostream> #include <string.h> using namespace std; int main(void) { string a = "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."; for(int i=0; i<a.size(); i++) { a[i] = a[i] == 'y' ? 'a' : (a[i] == 'z' ? 'b' : (96<a[i] && a[i]<121 ? a[i] + 2 : a[i])); } cout << a << endl; return 0; } 

结果:

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.maketr

ans() is recommended. now apply on the url.

 

Process returned 0 (0x0)   execution time : 0.031 s

Press any key to continue.

 

>>>>>>>把网址中的map换成ocr进入下一关

 

你可能感兴趣的:(pythonchallenge 【第1题】)