题解 | #字符个数统计#
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include <iostream> #include <map> using namespace std; int main() { string n; cin>>n; int count=0; map<char,int> m; for(int i=0;i<n.length();i++) { if(m.count(n[i])==0&&n[i]>=0&&n[i]<=127) count++; m[n[i]]=1; } cout<<count; } // 64 位输出请用 printf("%lld")