题解 | #字符个数统计#

字符个数统计

https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50

#include <stdio.h>
#include <string.h>
int main() {
    char str[500];
    int sh[128]={0};
    int i=0;
    scanf("%s",str);
    int n=strlen(str);
    int k=0;
    for(i=0;i<n;i++){
        if((str[i]>=0)&&(str[i]<=127))
        {
            if(sh[str[i]]==0)   {
                k++;
                sh[str[i]]++;
            }
        }
    }

    printf("%d",k);



    return 0;
}

全部评论

相关推荐

allin实习的大白...:我把第二个项目发出来了,如果感兴趣可以去研究研究,欢迎交流。 https://gitee.com/jtyjtyjty333/ind-dist-ai-sec-edge-cloud https://github.com/jtylab/ind-dist-ai-sec-edge-cloud
点赞 评论 收藏
分享
用微笑面对困难:985只有在应届生里面的优势是断层的在社招或者更远的工作中算是后续能力优先级
工作压力大,你会干什么?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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