From 71a6e456b59171a681bccff7eeba9db7367bca37 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Mon, 31 Oct 2016 22:21:50 +0700 Subject: Thêm đề Tin học trẻ Quốc gia 2016 Bảng B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THT-C/Q-2016/bai3.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100755 THT-C/Q-2016/bai3.py (limited to 'THT-C/Q-2016/bai3.py') diff --git a/THT-C/Q-2016/bai3.py b/THT-C/Q-2016/bai3.py deleted file mode 100755 index f4139a9..0000000 --- a/THT-C/Q-2016/bai3.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 -d = dict() -with open('bai3.inp') as f: - for i in f.readlines(): - for j in '.,;!?': - i = i.replace(j, ' ') - for j in i.split(): - d[j] = d.get(j, 0) + 1 -l = [(value, key) for (key, value) in d.items()] -l.sort(reverse=True) -with open('bai3.out', 'w') as f: - f.write(str(len(l)) + '\n') - for i, j in l: - f.write('{} {}\n'.format(i, j)) -- cgit 1.4.1