#字符个数统计#__huawei_no.10-2
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include <iostream> #include <set> using namespace std; int main() { string str; getline(cin,str); set<char> s; for(char c : str){ s.insert(c); } cout<<s.size()<<endl; } // 64 位输出请用 printf("%lld")
我看好多人用的是set,感觉确实挺好使。