找字符串中不重复的字符的个数
#include<iostream>
#include<string>
using namespace std;
int main()
{
int count = 0;
int num[128] = { 0 };
string a;
getline(cin, a);
for (int i = 0; i < a.length(); i++)
{
if (a[i] >= 0 && a[i] <= 127)
{
num[a[i]]++;
}
}
for (int i = 0; i < 127; i++)
{
if (num[i] != 0)
count++;
}
cout << count;
}