HJ10 字符个数统计 | 杂乱无章的初级程序员的题解

字符个数统计

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

#include <iostream>
#include <unordered_set>

using namespace std;

int main()
{
    unordered_set<char> s;
    char c;
    cin >> noskipws;
    while (cin >> c) {
        if (c == '\n') {
            break;
        }
        s.insert(c);
    }
    cout << s.size() << endl;
    return 0;
}
#华为机试#
全部评论

相关推荐

点赞 评论 收藏
分享
评论
2
2
分享

创作者周榜

更多
牛客网
牛客企业服务