본문 바로가기
python-algorithm

[백준] 10820

by 무적김두칠 2021. 1. 11.

1
2
3
4
5
6
7
8
9
10
11
12
13
import sys
while True:
 
        s=sys.stdin.readline()
        a=0;b=0;c=0;d=0
        for i in range(len(s)-1):
            if ord(s[i])==32: d+=1
            elif ord(s[i])>= 48 and ord(s[i])<=57: c+=1
            elif ord(s[i])>= 65 and ord(s[i])<=91: b+=1
            elif ord(s[i]) >= 97 and ord(s[i]) <= 123: a+=1
        if a==0 and b==0 and c==0 and d==0:break
        print(a,b,c,d)
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 10822  (0) 2021.01.11
[백준] 10821  (0) 2021.01.11
[백준] 10813  (0) 2021.01.11
[백준] 10812  (0) 2021.01.11
[백준] 10811  (0) 2021.01.11

댓글