解题思路:
注意事项:
参考代码:
def statistics_type(s_string):
num_alphbets = 0
num_num = 0
num_space = 0
num_others = 0
for item in s_string:
if item.isalpha():
num_alphbets += 1
elif item.isdigit():
num_num += 1
elif item.isspace():
num_space += 1
else:
num_others += 1
return num_alphbets, num_num, num_space, num_others
def main():
result = statistics_type(input())
for item in result:
print(item, end=' ')
main()
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题6.6 (C++代码)浏览:629 |
C语言考试练习题_保留字母 (C语言代码)浏览:700 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:373 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:486 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:600 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:516 |
输入输出格式练习 (C语言代码)浏览:849 |
生日日数 (C语言代码)浏览:1501 |
小O的乘积 (C++代码)浏览:751 |
幸运数 (C++代码)浏览:2862 |