题解 | 字符个数统计
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
string s;
while (cin >> s) { // 注意 while 处理多个 case
vector<bool> isex(128, false);
int count = 0;
for(char i : s){
if(isex[i]) continue;
count++;
isex[i] = true;
}
cout << count << endl;
}
}
// 64 位输出请用 printf("%lld")