BUUCTF-浪里淘沙
很明显就是词频统计。
import re a = open('浪里淘沙.txt','r').read() word = ['tonight', 'success', 'notice', 'we', 'example', 'crypto', 'should', 'back', 'space', 'learn', 'sublim', 'the', 'found', 'system', 'morning', 'enter', 'user'] b = {} for i in word: #添加字典元素 b[i] = a.count(i) # b = {'tonight': 117, 'success': 138, 'notice': 136, 'we': 124, 'example': 139, 'crypto': 141, 'should': 131, 'back': 129, 'space': 129, 'learn': 134, 'sublim': 132, 'the': 140, 'found': 125, 'system': 130, 'morning': 113, 'enter': 120, 'user': 133} b = sorted(b.items(),key=lambda x:x[1]) # b = [('morning', 113), ('tonight', 117), ('enter', 120), ('we', 124), ('found', 125), ('back', 129), ('space', 129), ('system', 130), ('should', 131), ('sublim', 132), ('user', 133), ('learn', 134), ('notice', 136), ('success', 138), ('example', 139), ('the', 140), ('crypto', 141)] print(b[4][0]+b[8][0]+b[11][0]+b[15][0]+b[16][0])
最后得到的是:foundshouldlearnthecrypto 我也不知道为什么。。问题不大,待定
但是很明显flag是weshouldlearnthecrypto