字符个数统计
字符个数统计
http://www.nowcoder.com/questionTerminal/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include <stdio.h> #include <string.h> int main(void) { char str[1000] = { 0 }; int num[128] = { 0 }; int count = 0; gets(str); for (int i = 0; i < strlen(str); i++) if(!num[str[i]]) num[str[i]] = ++count; printf("%d", count); return 0; }