题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
s=input() a=0 b=0 c=0 d=0 for i in s: if ord(i.lower()) in range(ord("a"),ord("z")+1): a=a+1 elif i == " ": b=b+1 elif ord(i) in range(ord("0"),ord("9")+1): c=c+1 else: d=d+1 print(a) print(b) print(c) print(d)