str = input("请输入一个字符串:")
letters = 0
digits = 0
spaces = 0
others = 0
for char in str:
if char.isalpha():
letters += 1
elif char.isdigit():
digits += 1
elif char.isspace():
spaces += 1
else:
others += 1
print(f"字母:{letters},数字:{digits},空格:{spaces},其他:{others}")