HJ10题解 | #字符个数统计#
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { string input; getline(cin, input); vector<char> vec; for (int i = 0; i < input.size(); i++) { if (find(vec.begin(), vec.end(), input[i]) == vec.end()) { vec.push_back(input[i]); } } cout << vec.size(); }#刷题#