字符统计个数
字符个数统计
http://www.nowcoder.com/questionTerminal/eb94f6a5b2ba49c6ac72d40b5ce95f50
每个字符对应唯一,忘了换行符的码了,故赋初值count为-1
#include<stdio.h>
int main(){
char num = 0,str[128] = {0};
int count = -1;
while(scanf("%c",&num) != EOF){
str[(int)num-1] = 1;
}
for(int i = 0;i < 128;i++)
{
if(str[i] != 0)
count++;
}
printf("%d",count);
return 0;
}