Files
python/TangDou/LanQiaoBei/LanQiao14STEMA202208/3_0.cpp

18 lines
335 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
string str = "cacd";
// 3
int bucket[26];
int cnt;
int main() {
//桶计数
for (int i = 0; i < str.size(); i++) bucket[str[i] - 'a']++;
for (int i = 0; i < 26; i++)
if (bucket[i]) cnt++;
cout << cnt << endl;
// t.size()!=cnt
return 0;
}