【十二题解】 | #字符个数统计#
字符个数统计
http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include<stdio.h>
int main(){
int hash[128] = {0};
char chareacter;
while(chareacter!='\n'){
chareacter=getchar();
hash[chareacter] = 1;
}
int ans =0;
for (int i=0; i<128; i++){
if (hash[i] == 1){
ans+=1;
}
}
printf("%d", ans-1);
return 0;
}