题解 | #字符个数统计#

字符个数统计

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

//https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50?tpId=37&tqId=21233&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <iostream>
#include <set>

using namespace std;

int main() {
    string s;

    while (cin >> s) {
        set<char> clist;
        for(auto c:s){
            if(0<=c&&c<=127)
                clist.insert(c);
        }

        cout << clist.size();
    }
}

全部评论

相关推荐

字节 飞书绩效团队 (n+2) * 15 + 1k * 12 + 1w
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务