Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- string s;
- cin >> s;
- vector<int> a(26);
- for(int i = 0; i < s.size() - 1; ++i){
- if(s[i] < 'a' || s[i] > 'z')
- continue;
- a[s[i] - 'a']++;
- }
- for(int i = 0; i < 26; ++i){
- if(!a[i])
- continue;
- char x = i + 'a';
- cout << x << " " << a[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment