题解 | #字符个数统计#
字符个数统计
http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
#include #include<unordered_set> #include using namespace std; int main(void) { string s; cin>>s; int len=s.length(); unordered_set num; int count=0; for(int i=0;i<len;i++) { int value=s[i]; if(value>=0&&value<=127) { if(num.find(value)==num.end()) { num.insert(value); count++; } } } cout<<count; return 0;
}