【十二题解】 | #字符个数统计#

字符个数统计

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;

}

全部评论

相关推荐

求问!考研下岸,打算参加春招,我这个bg能进啥厂,或者需要搞点深度项目再投吗
Java抽象带篮子_...:直接海投,可以看看我的考研失利速成冲春招贴,里面详细写了简历怎么写,学哪些项目可以速成
点赞 评论 收藏
分享
01-26 19:51
门头沟学院 Java
isabener:怎么感觉像群发的呢
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务