Skip to content

Commit dfb6aaa

Browse files
authored
Add files via upload
1 parent 4aebd2b commit dfb6aaa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

week15/JeongMin/생태학.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'''
2+
import sys 안 쓰면 오류 나는 것으로 보임
3+
'''
4+
from collections import defaultdict
5+
import sys
6+
input=sys.stdin.readline
7+
8+
dic=defaultdict(int)
9+
total=0
10+
while True:
11+
tree=input().rstrip()
12+
if not tree:
13+
break
14+
dic[tree]+=1
15+
total+=1
16+
17+
dic=sorted(dic.items())
18+
for k, v in dic:
19+
print(k, '%.4f' %round((v/total)*100, 4))

0 commit comments

Comments
 (0)