题解 | #字符个数统计#笨办法
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
import sys n=input() sum=0 assert 1<=len(n)<=500 asc=[0]*128 for x in n: asc[ord(x)]=1 for i in asc: sum=sum+i print(sum)
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
import sys n=input() sum=0 assert 1<=len(n)<=500 asc=[0]*128 for x in n: asc[ord(x)]=1 for i in asc: sum=sum+i print(sum)
相关推荐