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;
}#华为机试#
查看18道真题和解析