题解 | #统计字符#
统计字符
http://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
import re
while(True):
try:
a = input().strip()
c = 0
s = 0
d = 0
o = 0
for i in a:
if re.search('[a-zA-Z]', i):
c += 1
elif re.search('\d', i):
d += 1
elif re.search(' ', i):
s += 1
else:
o += 1
print(c)
print(s)
print(d)
print(o)
except:
break
