1
2
3
4
5
6
7
8
9
|
import sys
while True:
s=sys.stdin.readline()
if s[0]=='#' : exit()
ans = [0] * 26
s=s.lower()
for i in range(len(s)-1):
if ord (s[i])<=122 and ord (s[i])>96 : ans[ord(s[i])-97]=1
print(sum(ans))
|
cs |
저는 문자열 카운팅 같은 문제는 주로 아스키코드를 이용해 풀고 있어요
반응형
댓글